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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      51 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      142 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      160 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      96 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      275 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X