sending parameters to an indicator
Forums › ProRealTime English forum › ProBuilder support › sending parameters to an indicator
- This topic has 8 replies, 2 voices, and was last updated 7 years ago by Roger.
-
-
11/07/2017 at 10:06 AM #51763
Hello,
I am new on this… Here is my question:
I created a personalised indicator. I would like to call this indicator from an algortithm. When making the call, is there a way to include a parameter that I pass to the indicator.
It looks like I can send parmeters for a standard indicator (p, q, … for bollanger…).
I don’t see this on the online documentation.
Thanks for your help.
Roger
11/07/2017 at 11:18 AM #51776Official documentation https://www.prorealcode.com/documentation/call/ .
Variables on the left side are those returned in the same order as in RETURN.
Parameters after CALL should match the order in which you defined dynamic variables when building your indicator.
1 user thanked author for this post.
11/07/2017 at 11:29 AM #51778thanks for the answer. my question is about the after call parameters (parameter1, etc).
myValue = CALL “myIndicator”[parameter1,parameter2]
if i write myValue = CALL “myIndicator”[50,10] : how can i use them in myIndicator ?
I would like (as an example), send 50 to myIndicator that will use it in a variable ( for example var = parameter1 * 2. Since I put 50 in the call, this means that var would be 100 in the Indicator program
i hope this is clearer
11/07/2017 at 11:52 AM #51782When I read your answer again, you mention “dynamic variables when building your indicator.”
i guess this is why i was not understanding how this works.
I will write again my indicator and define the variables. This should fix the problem.
Thanks again
Roger
11/07/2017 at 12:00 PM #51785It was clear even before.
You have to define as many dynamic variables as you want when building your indicator.
On the bar above your code there is a button with a wrench that will open a box to add variables with default values that you will overwrite when calling.
The order in which you write your parameters must be in the exact order you added your variables.
If you define variables Avgx and C, the value of parameter1 will be stored in Avgx, the second one in C.
Roberto
11/07/2017 at 12:02 PM #51786It was clear even before.
You have to define as many dynamic variables as you want when building your indicator.
On the bar above your code there is a button with a wrench that will open a box to add variables with default values that you will override when calling.
The order in which you write your parameters must be in the exact order you added your variables.
If you define variables Avgx and C, the value of parameter1 will be stored in Avgx, the second one in C.
Roberto
11/07/2017 at 12:04 PM #51788Sorry for duplicating my post, I was trying to edit it, instead I doubled it!
11/07/2017 at 12:26 PM #51798Let me know if you can’t fix it.
As soon as I am in front of my PC I’ll be able to attach some screenshots.
11/07/2017 at 1:38 PM #51810 -
AuthorPosts
Find exclusive trading pro-tools on