Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Differentiate between live and historical bars

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

    Differentiate between live and historical bars

    I am coding a breakout strategy.
    It needs a setup and then it waits for breakout.
    Problem is that NT handles historical bars as live bars: so it detects a setup that happened BEFORE live time when I start the strategy (since it processes all historical bars too) and enters on the next available live bar.

    It is not syncing, it is just evaluating a breakout condition of
    if (close[0] is > setupPriceLevel + 10 * TickSize)
    which will be true after a historical setup as well.

    I hope it's understandable.

    #2
    Hi Zapzap,

    Use the Historical bool to determine if your strategy is processing live data or historical data.

    For example:

    if (Historical)
    {
    // execute code for historical data
    }
    else
    {
    // execute code for live data
    }

    Below is a link to the help guide on Historical.
    http://www.ninjatrader.com/support/h...historical.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks. I missed this somehow.

      And is there an option for historical AND not backtest?
      Last edited by Zapzap; 08-11-2014, 12:45 PM.

      Comment

      Latest Posts

      Collapse

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