Re: How can I pick up values of variables for previous bars?
jcm21
See the solutions provided in this thread on the same topic
Alex
Originally posted by jcm21 When I have my own declared variable "output2" as in:
var output2=xxxx+yyyy;
How can I pick up values of output2 for previous bars?
When output2 is not the only variable returned from the main program will the proposed solution still work?
(i.e.)
function main()
{
...
...
var output2=xxxx+yyyy;
...
...
return new Array (output2,output5,output6);
}
Please ignore the last reply (from me). I think I just verified that, yes, when output2 is not the only variable returned from the main program the proposed solution will work. So I think this is the end of this thread. Thanks again Alex for your help.
In summary, is it true that I can use the ref() function only if only one variable is returned from Main?
(and therefore if multiple values are returned the method explained in this thread must be used ?)
jcm21
You can use the ref() function also when you are returning an array of values. See this thread for an example
Alex
Originally posted by jcm21 I take it back - the last reply was not the last.
One more question:
In summary, is it true that I can use the ref() function only if only one variable is returned from Main?
(and therefore if multiple values are returned the method explained in this thread must be used ?)
Comment