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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
635 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
365 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
106 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
567 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
571 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment