Announcement

Collapse
No announcement yet.

retieving data from arrays(series)

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

  • retieving data from arrays(series)

    Tried several ways to get the information out of the series.
    Need to use the information to assess MA's postion relative to price and close.
    I have messed with your code abit.
    sam

  • #2
    sam
    To retrieve a value from a series you need to use the .getValue() method as shown in the example below
    Alex

    PHP Code:
    function main(){
        
        var 
    Study sma(10);//Study is a series
     
        
    var Value0 Study.getValue(0);//Value0 is the current value of the series
        
    var Value1 Study.getValue(-1);//Value1 is the value of the series at the prior bar
        
    var Value2 Study.getValue(-2);//Value2 is the value of the series two bars back
        //etc
     
        
    return Value0;

    Comment


    • #3
      Thank you again for your knowledge
      sam

      Comment


      • #4
        sam
        My pleasure
        Alex

        Comment

        Working...
        X