Announcement

Collapse
No announcement yet.

Accessing values of Studies in Previous Bars

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Accessing values of Studies in Previous Bars

    Good Day.

    I am totally new to EFS, just started writing a script based on the strRSI.efs

    I want to use the values of RSI for the previous bar, and bars before, how do write code to do that?

    Also, how can I write values etc to a text file so I can debug & test?

    I am also looking to implement STOP and LIMIT exits - can I store the entry price so that I can put stops at specific values away from the entry price?

    Please direct me to examples and areas in the manuals where I can get this info.

    Thanks,

    DB

  • #2
    WELCOME TO THE JUNGLE!

    I'll start by answering your question because I know how frustrating this is!

    From the Knowledgebase:

    PHP Code:
    To Create a Series 

    var myStudy null
    var 
    bInit false

    function 
    main() { 
    var 
    myVar

       if ( 
    bInit == false ) { 
           
          
    myStudy rsi14 ); 
          
    bInit true

       } 

       
    //retrieve the current value 
       
    myVar myStudy.getValue(0); 

       return( 
    myVar ); 


    So you can now do this:

    PHP Code:
    RSI_this_bar myStudy.getValue(0);   

    RSI_1_bar_ago myStudy.getValue(-1);   

    RSI_2_bars_ago myStudy.getValue(-2); 
    MAY ALL YOUR FILLS BE COMPLETE.
    Last edited by buzzhorton; 08-15-2006, 09:03 AM.

    Comment

    Working...
    X