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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      67 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      36 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      60 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      62 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X