Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

meaning of Open[-1] ?

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

    meaning of Open[-1] ?

    Hi Ninjas,

    After debugging I found some wrong Code-Elements in my Strategie.
    Instead of add a constant value to a Bar, I substract that Value
    In Result the Code works with Open[-1] Close[-1] and Median[-1]
    Surprisingly NT7 accept this Bug, and during the Backtesting my Code works with historical Data and - for while - with RealTime-Data as well. Then I receive an Error.

    So my Question - What use NT for that mysterious "future" Bars?
    Perhaps some actual Informations from OnMarketData?

    Regards
    Trendseeker

    #2
    Hi Trendseek, unfortunately using a negative index is not supported in NinjaScript. With an index of 0 you're already at the current most bar.

    Comment


      #3
      Hello Bertrand,
      and thanks for your fast response - as usual!

      But this wasn't what I want to know...
      Perhaps my Question was a bit unclear:
      What Values are NT using for Bars with negative Index?

      In Other Words: What actual Values are NOT using for the current most bar (Index 0) ?

      PS:
      I had a *verry* long Debugging Session because of that stupid little Error - and so I am realy curious about that strange topic...

      Best
      Trendseeker

      Comment


        #4
        Sorry trendseeker, we would not support using negative indices, as such I would not have further info here unfortunately.

        The currentbars index 0 is the last received tick (CalculateOnBarClose = false) or the last completed bars data (CalculateOnBarClose = true).

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        572 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        331 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        549 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        550 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X