Reply

Error ReplacePendingOrders

2 replies

Optimus

Customer, bbp_participant, community, 26 replies.

Visit profile

8 years ago #114185

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.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

8 years ago #132606

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

0

Optimus

Customer, bbp_participant, community, 26 replies.

Visit profile

8 years ago #132633

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

 

Thanks.

0

Viewing 2 replies - 1 through 2 (of 2 total)