Announcement

Collapse
No announcement yet.

Assigning previous bar values / need help

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

  • Assigning previous bar values / need help

    Following do not work, any idea why? Any suggestions?

    function preMain(){
    var x = 0;
    }
    function main() {
    var psar1 = sar(0.02,0.02,0.2);

    var psar11 = psar1[1];
    return psar11
    }

    Somehow program do not recognize psar1[1] and do not assign the value to psar11.

    Any suggestions will be helpful.

  • #2
    kpmci
    You are using an incorrect syntax to retrieve the value of the psar1 series
    var psar11 = psar1[1];
    See this article in the EFS KnowledgeBase for the complete description and syntax required for the psar() function.
    In the Code Examples of that article note the section Initialize a Series Object which provides you a specific set of examples on how to retrieve single values
    Alex


    Originally posted by kpmci View Post
    Following do not work, any idea why? Any suggestions?

    function preMain(){
    var x = 0;
    }
    function main() {
    var psar1 = sar(0.02,0.02,0.2);

    var psar11 = psar1[1];
    return psar11
    }

    Somehow program do not recognize psar1[1] and do not assign the value to psar11.

    Any suggestions will be helpful.

    Comment


    • #3
      crossrs above or crosses below statements

      Originally posted by ACM View Post
      kpmci
      You are using an incorrect syntax to retrieve the value of the psar1 series
      var psar11 = psar1[1];
      See this article in the EFS KnowledgeBase for the complete description and syntax required for the psar() function.
      In the Code Examples of that article note the section Initialize a Series Object which provides you a specific set of examples on how to retrieve single values
      Alex
      " Crosses above below"

      Is there anything like crosses above or below?
      Example: macd crosses above 0, macd crosses below 0, sar crosses above close or below close.

      Also you sent me ref article on sar syntax, how do I get the syntax for all formulas or studies?

      Thank you!

      Comment


      • #4
        kpmci
        Search these forums and you will find plenty of examples on how to code crosses for a variety of indicators as the topic has been covered at length before.
        The EFS KnowledgeBase to which I pointed you for that specific article contains all the information related to EFS and also includes the EFS Library which is a collection of scripts provided by eSignal.
        Alex


        Originally posted by kpmci View Post
        " Crosses above below"

        Is there anything like crosses above or below?
        Example: macd crosses above 0, macd crosses below 0, sar crosses above close or below close.

        Also you sent me ref article on sar syntax, how do I get the syntax for all formulas or studies?

        Thank you!

        Comment

        Working...
        X