Thanks!
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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 Enkidu, Yesterday, 06:40 AM
|
9 responses
36 views
0 likes
|
Last Post
by Enkidu
Yesterday, 01:11 PM
|
||
Started by kezyclaire, 12-01-2023, 09:37 AM
|
3 responses
151 views
0 likes
|
Last Post Today, 07:03 AM | ||
Started by volIQ, Yesterday, 04:28 PM
|
1 response
13 views
0 likes
|
Last Post Today, 06:55 AM | ||
Started by martini, Yesterday, 04:45 PM
|
1 response
10 views
0 likes
|
Last Post Today, 06:45 AM | ||
Started by proptradingshop, 03-21-2024, 09:50 AM
|
5 responses
26 views
0 likes
|
Last Post Today, 05:17 AM |
Comment