explanation of the CALL instruction
Forums › ProRealTime English forum › ProOrder support › explanation of the CALL instruction
- This topic has 5 replies, 3 voices, and was last updated 5 years ago by
GraHal.
-
-
10/22/2019 at 9:09 PM #110905
Hi ALL,
I am trying to understand the “CALL” function.
I read the documentation but didn’t how to use it in the code.
For example, I saw strategy that had 5 values but 6 parameters (rsi indicator) , also the number didn’t make sense:
value1, value2, value3, value4, value5 = CALL RSI (30, 0, 1, 100, 8, 10)(CLOSE)
What the coder means by that?
Thanks for any help.
Assi
10/22/2019 at 10:29 PM #110913The values are the returns of the indicator so if the last line of the indicator is:
1return a,b,c,d,ethen value1 = a, value2 = b value3 = c etc
The parameters in brackets are the variables that the indicator needs. So for example an RSI indicator that just needs to know the period that it should be calculated on would just need one parameter. 14 for RSI[14] or 2 for RSI[2] for example.
The parameters are the adjustable variables that you would find in the indicator settings window in the order they are presented there.
1 user thanked author for this post.
10/22/2019 at 11:13 PM #11091410/22/2019 at 11:39 PM #110915If there are only 3 values and 5 parameters (none of them is zero), then the logic is that the first value always get the firs parameter?
I’m not sure that I understand what you are asking.
An indicator might have four adjustable parameters and return two values.
You call it with whatever parameter values you want to use and it returns the output of that indicator.
So if you have an indicator (called myIndicator) that is as follows with adjustable variables of p1, t1, p2, t2 in that order:
1234ave1 = average[p1,t1]ave2 = average[p2,t2]return ave1, ave2Then you call it in your strategy using:
1ave1, ave2 = CALL"myIndicator"[50,0,100,1](close)That would retrieve the 50 period simple moving average and the 100 period exponential average and your strategy would then store those values as ave1 and ave2
10/23/2019 at 12:02 AM #11091610/23/2019 at 10:00 AM #110929Link to explanation added as Log 179 here …
-
AuthorPosts