Not logged in
Viewing 3 posts - 1 through 3 (of 3 total)

Forums>StrategyQuant>Application Support>Error ReplacePendingOrders

  • #114185 |
    Customer
    21 Posts
    Hello, we have an strategy generated by SQ running on NinjaTrader. When we run the strategy in backtest, pending orders live one bar more than in the real market or in simulation. For instance, if we have a maximum of 11 bars for the pending order, then in backtest the pending order gets cancelled at the eleventh bar but in the real marked it gets cancelled at the tenth bar. How can this be possible? Is there any possible workaround?
     
    Thank you.
    #132606
    Moderator
    1559 Posts

    Not sure what could cause this. Maybe it has something to do with “evaluate on bar close”. So in live/sim the order is deleted while the bar is being created but in backtest it’s evaluated once bar closes … that’s why there is 1 bar increment

     

    See here “Running a Strategy at the Close of a Bar or Tick by Tick”

    http://ninjatrader.com/support/helpGuides/nt7/?discrepancies_real_time_vs_bac.htm

     

     

    ¢  During backtest, strategies can ONLY be processed at the close of each bar

    ¢  During real-time operation, you have a choice to run a strategy tick by tick (CalculateOnBarClose set to false) which can produce different results

    #132633
    Customer
    21 Posts

    Ok we are going to try setting CalculateOnBarClose to true. If this doesn’â„¢t work we will tell you.

     

    Thanks.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.