Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Start Behaviour is a pain, why?
Collapse
X
-
Hello Skifree
You can do that, you would need to program your strategy to enter trades only in realtime. When you apply a strategy will backtest over the historical data before entering into realtime. The default start behavior is to wait for your strategy to finish any positions it entered before starting to work in realtime.
-
Hello Skifree,
Yes, when you backtest a strategy that's the exact same process that happens when you apply a strategy to a chart. It places historical trades during the backtest on the chart or in the strategy analyzer. If you wanted to you could make a user input to toggle historical trading so that you could still backtest it.
Comment
-
Hello Skifree,
Your strategies logic would need to do that. Wait until flat is waiting for your strategies exit logic to happen so it becomes flat, that is a virtual trade because its closing a historical position. Real trades would be entered once the strategy actually starts running after the historical position is closed.
To have it start right away you would either have to not make historical positions or have logic which exits the trade so its flat when it enters realtime.
Comment
-
Thanks for the help. For others: I use a custom input bool "isBacktest" to allow me more flexibility here. This seems to work so that I can enter flat without losing money going flat.
Code:protected override void OnBarUpdate() { if (isBacktest == false && State == State.Historical) { return; }
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
602 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
347 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
559 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
558 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment