explanation of the CALL instruction

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #110905 quote
    assi
    Participant
    Senior

    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

    #110913 quote
    Vonasi
    Moderator
    Master

    The values are the returns of the indicator so if the last line of the indicator is:

    return a,b,c,d,e

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

    GraHal thanked this post
    #110914 quote
    assi
    Participant
    Senior

    Got it!!

    wow!! i really thank you.

    If 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?

    #110915 quote
    Vonasi
    Moderator
    Master

    If 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:

    ave1 = average[p1,t1]
    ave2 = average[p2,t2]
    
    return ave1, ave2

    Then you call it in your strategy using:

    ave1, 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

    #110916 quote
    assi
    Participant
    Senior

    Thanks for the example, it’s clears the thing.

     

    Thanks for your time.

    #110929 quote
    GraHal
    Participant
    Master

    Link to explanation added as Log 179 here …

    Snippet Link Library

    #249872 quote
    umrk
    Participant
    New

    If I do this, when trying to save the code of my indicator, it will refuse to do it, based on the fact I have not defined the variables p1, t1, p2,t2. No ?

    #249873 quote
    GraHal
    Participant
    Master

    Define p1, t1, p2,t2 as 50,0,100,1 first then try. 

    robertogozzi and Iván González thanked this post
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

explanation of the CALL instruction


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
assi @assi Participant
Summary

This topic contains 7 replies,
has 2 voices, and was last updated by GraHal
6 months, 2 weeks ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/22/2019
Status: Active
Attachments: No files
Logo Logo
Loading...