spacer esignallogo
 |  Contact Us   


User CPRegisterMember Listcalendar




eSignal Forums eSignal Forums » EFS / API Development » EFS Studies » Adding Formula Parameters question
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply

- Posted: 08-07-2010 08:06 PM Old PostReport | IP: Logged

Alexis C. Montenegro

Registered: Oct 2002
Location:
Posts: 18052
Status: OFFLINE


Reply with QuoteEdit/Delete Message

shaeffer
You are welcome
Alex


quote:
Originally posted by shaeffer
Success. Thanks, Alex

View Alexis C. Montenegro's profile Send Alexis C. Montenegro a Private Message Search for posts by Alexis C. Montenegro Add Alexis C. Montenegro to your buddy list


- Posted: 08-07-2010 06:32 PM Old PostReport | IP: Logged

shaeffer
Member

Registered: Feb 2003
Location: Northern California
Posts: 414
Status: OFFLINE


Reply with QuoteEdit/Delete Message

Success. Thanks, Alex

View shaeffer's profile Send shaeffer a Private Message Search for posts by shaeffer Add shaeffer to your buddy list


Re: Adding Formula Parameters question - Posted: 07-29-2010 09:55 PM Old PostReport | IP: Logged

Alexis C. Montenegro

Registered: Oct 2002
Location:
Posts: 18052
Status: OFFLINE


Reply with QuoteEdit/Delete Message

shaeffer
Add a boolean FunctionParameter called for example "Test", set it to true by default and add the parameter to the arguments of main. Then enclose the entire section of code
if(getBarState()==BARSTATE_ALLBARS){
...
if (bCurrentDay==false){
return;
}

in a conditional statement that checks if Test is true.
When the Test parameter is set to false that entire section of code will not be executed thereby returning the plots also on previous days
Alex


quote:
Originally posted by shaeffer
Hello,
I've been using the script below to view just todays efs data while the chart above it displays multi-days of price data. Sometimes however I want to view multi-days of efs data also. I've been trying to use Formula Parameters so I can easily 'bypass' the script below via Edit Studies, but am having no luck. I am hoping someone knows of an efs where this has been done. Or maybe there is an easier way?

Any help would be appreciated
Thanks
shaeffer

function preMain() {

var bCurrentDay = false;

function main() {

if(getBarState()==BARSTATE_ALLBARS){
bCurrentDay=false;
}
if (bCurrentDay == false && getDay(0) != getDay(-1)){
var xTime = getValue("time");
var xDate = new Date();
var sTime = (xTime.getMonth()+1+"/"+xTime.getDate()+"/"+xTime.getFullYear());
var sToday = (xDate.getMonth()+1+"/"+xDate.getDate()+"/"+xDate.getFullYear());
if ( sTime == sToday ) {
bCurrentDay = true;
}
}
if (bCurrentDay==false){
return;
}

View Alexis C. Montenegro's profile Send Alexis C. Montenegro a Private Message Search for posts by Alexis C. Montenegro Add Alexis C. Montenegro to your buddy list


Adding Formula Parameters question - Posted: 07-29-2010 09:32 PM Old PostReport | IP: Logged

shaeffer
Member

Registered: Feb 2003
Location: Northern California
Posts: 414
Status: OFFLINE


Reply with QuoteEdit/Delete Message

Hello,
I've been using the script below to view just todays efs data while the chart above it displays multi-days of price data. Sometimes however I want to view multi-days of efs data also. I've been trying to use Formula Parameters so I can easily 'bypass' the script below via Edit Studies, but am having no luck. I am hoping someone knows of an efs where this has been done. Or maybe there is an easier way?

Any help would be appreciated
Thanks
shaeffer

function preMain() {

var bCurrentDay = false;

function main() {

if(getBarState()==BARSTATE_ALLBARS){
bCurrentDay=false;
}
if (bCurrentDay == false && getDay(0) != getDay(-1)){
var xTime = getValue("time");
var xDate = new Date();
var sTime = (xTime.getMonth()+1+"/"+xTime.getDate()+"/"+xTime.getFullYear());
var sToday = (xDate.getMonth()+1+"/"+xDate.getDate()+"/"+xDate.getFullYear());
if ( sTime == sToday ) {
bCurrentDay = true;
}
}
if (bCurrentDay==false){
return;
}

View shaeffer's profile Send shaeffer a Private Message Search for posts by shaeffer Add shaeffer to your buddy list


All times are GMT. The time now is 02:51 AM. Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread

Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF