Thanks!
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Enable or Disable Backtesting
Collapse
X
-
Enable or Disable Backtesting
Can someone tell where within a Ninjascript, I can find the line that enables or disables the strategy from being back-tested? I have a strategy, and it will not allow me to back-test for some reason. When I pull it up in Strategy Analyzer and try to run a back test, nothing happens. So there must be a line in the code preventing this. How can I get it to back-test. Can I just go in and edit the code to let me?
Thanks! -
Hello Corbett,
Thank you for your post.
Usually "if(Historical)return;" will prevent this, look for this at the beginning of the OnBarUpdate().
Otherwise, if the backtest still does not work or the line is not present please answer these questions:- Do you see results when running the same test on the SampleMaCrossOver strategy in NinjaTrader with the same settings as your strategy?
- Are you connected to your data feed provider when running this test?
- Do you have data in the Historical Data Manager (Tools > Historical Data Manager) for the instrument and period you are testing the strategy on?
- Do you see results when running the same test on the SampleMaCrossOver strategy in NinjaTrader with the same settings as your strategy?
-
Hello, thanks for the reply. So I found the section an line you were referring to. I have posted it below. I am fairly new, so how would I change it to enable back-testing.
#region OnBarUpdate
protected override void OnBarUpdate()
{
if (Historical && !HistoryVal) return;
Thanks!
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
59 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
143 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
161 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
97 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
276 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment