Backtester trades on sim account

Hi, I´m getting backtester trades on sim live feed account starting from data loaded either 10 bars or 10 days back. Then it hits the error of positions max level and does not make any trades if conditions met. Any solution for that? Thank you.

Hi Lauri,

Two possible things come to mind:

  1. As posted elsewhere a few moments ago…

Read this first to understand what is going on.
https://support.ninjatrader.com/s/article/Developer-Guide-How-historical-and-real-time-data-is-processed?language=en_US

Then, my recommendation is to add this to your OnBarUpdate():
if (CurrentBar < BarsRequiredToTrade || State == State.Historical) return;

Checking for State.Historical will have the NT8 engine ignore all previous bars, etc. until your at the point of real time and or your Playback start time.
Next I would start your testing at the beginning of a session (i.e., 6pm US Eastern for most instruments), or at the time you plan to turn on your strategy for each session. Imo, this gives you the cleanest/realest situation to test your strategy.

  1. Read through this as I believe it directly addresses your question:
    https://support.ninjatrader.com/s/article/Developer-Guide-Exceeded-entry-signals-limit-based-on-EntryHandling-and-EntriesPerDirection?language=en_US

Hope that helps,
Matt

1 Like