Announcement

Collapse
No announcement yet.

MA of a user defined variable (in EFS editor)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MA of a user defined variable (in EFS editor)

    I am trying to do this in the formula editor.

    I have a user-defined variable named say SL, which is computed from price.

    I want to compute the moving average on the values of SL. Can I do this? I want to write something like
    var SL = <some calculation>;
    var newMA = new MAStudy(3, 0, SL, "CLOSE", MAStudy.SIMPLE);

    I am getting a syntax error saying parameter 3 is incorrect.
    Any help is appreciated.
    Thanks.

  • #2
    bf2
    The reason you are getting a syntax error is because the efs1 functions (such as the one you are using in your example) cannot accept custom variables as the source. Those functions can only use a price series (ie "High", "Low", "Close", etc) and in some cases another built-in study.
    To do what you want you will need to use the efs2 functions which can use a price series, another built-in study or a custom series as a source.
    For a detailed explanation of how to accomplish this see the example provided in this thread in reply to a similar question.
    Alex


    Originally posted by bf2
    I am trying to do this in the formula editor.

    I have a user-defined variable named say SL, which is computed from price.

    I want to compute the moving average on the values of SL. Can I do this? I want to write something like
    var SL = <some calculation>;
    var newMA = new MAStudy(3, 0, SL, "CLOSE", MAStudy.SIMPLE);

    I am getting a syntax error saying parameter 3 is incorrect.
    Any help is appreciated.
    Thanks.

    Comment

    Working...
    X