sending parameters to an indicator

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #51763 quote
    Roger
    Participant
    Average

    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

    #51776 quote
    robertogozzi
    Moderator
    Master

    Official 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.

    Roger thanked this post
    #51778 quote
    Roger
    Participant
    Average

    thanks 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

    #51782 quote
    Roger
    Participant
    Average

    When 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

    #51785 quote
    robertogozzi
    Moderator
    Master

    It 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

    #51786 quote
    robertogozzi
    Moderator
    Master

    It 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

    #51788 quote
    robertogozzi
    Moderator
    Master

    Sorry for duplicating my post, I was trying to edit it, instead I doubled it!

    #51798 quote
    robertogozzi
    Moderator
    Master

    Let 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.

    #51810 quote
    Roger
    Participant
    Average

    it’s fixed

    thanks

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.

sending parameters to an indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Roger @roger Participant
Summary

This topic contains 8 replies,
has 2 voices, and was last updated by Roger
8 years, 4 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/07/2017
Status: Active
Attachments: No files
Logo Logo
Loading...