Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Accessing indicator last value.

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

    Accessing indicator last value.

    Hi,

    I have an indicator and in the OnBarUpdate() before using the Set method to inserting a new value I want to access the last value. What should I use indicator[0] or indicator[1]?
    For example if I want to set an indicator to the last value what should I do:
    1. Indicator.Set(Indicator[0])
    or
    2. Indicator.Set(Indicator[1])

    I hope I made my self clear :-)

    Thanks in advance!
    Last edited by freewind; 02-20-2011, 03:42 AM.

    #2
    The most current value would be setting at index position 0, with CalculateOnBarClose determining if you get the last value of the current developing bar (false, in RT only) or the value of the last closed bar (true, backtesting default).
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by lorem, Today, 09:18 AM
    0 responses
    2 views
    0 likes
    Last Post lorem
    by lorem
     
    Started by hazylizard, Today, 08:38 AM
    4 responses
    10 views
    0 likes
    Last Post hazylizard  
    Started by geddyisodin, Today, 05:20 AM
    2 responses
    18 views
    0 likes
    Last Post geddyisodin  
    Started by Max238, Today, 01:28 AM
    5 responses
    47 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by giulyko00, Yesterday, 12:03 PM
    3 responses
    13 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X