![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Dec 2009
Posts: 102
Thanks: 4
Thanked 0 times in 0 posts
|
I'm currently using Ninjatrader 7.0.0.16 to backtest a strategy.
I'm finding that I get some very strange results when backtesting. here is a list of some of the problems:
Many thanks Mark [IMG]file:///C:/Users/user/AppData/Local/Temp/moz-screenshot.png[/IMG] |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Aug 2010
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
|
I was consider upgrade to version beta 22 ... there were big improvements after beta 17
|
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Dec 2009
Posts: 102
Thanks: 4
Thanked 0 times in 0 posts
|
Thanks Mark...I'll give it a try.
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 90 times in 82 posts
|
MJUK10, yes you'll have to upgrade to the latest beta because there were many changes made between beta 22 and beta 16 in the backtesting area. Please let us know if the issue persists after the update - also, read the upgrade instructions carefully, there could be something specific relating to your update path.
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#5 | |
|
Senior Member
Join Date: Dec 2009
Posts: 102
Thanks: 4
Thanked 0 times in 0 posts
|
Austin. I updated to the latest version and it still did not work so I rolled the code back to an ealier version where the bug wasn't present and started again.
However, after getting it working I seem to have found another bug! All I did was insert the following code at the beginneing (initialize section) to make reference to different timeframes. Quote:
I like Ninjatrader and want to use it to trade live in due course but i'm beginning to lose faith in the software due to all these random errors. Can you give me any explanation why this might happen? |
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
|
Mark, it will have an effect, even if just added, as the OnBarUpdate() would still be called for those timeframes as well, if you don't return out specifically or filer by the BarsInProgress, please see the SampleMultiTimeFrame or SampleMultiInstrument as examples.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Dec 2009
Posts: 102
Thanks: 4
Thanked 0 times in 0 posts
|
Bertrand
I was under the impression it they would only have an affect when the specific bararray is made reference to in the code. What you're saying if I understand it correctly is the entire code will be processed over all the called time frames? How to i stop this? Thanks Mark |
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
|
The OnBarUpdate() is called for all added series, you can just add a print to it to see the sequence of calls - Print(Time[0] + " BIP " + BarsInProgress);
You would need to work with if sets to only execute logic on a specific BarsInProgress being called : if (BarsInProgress == 0) { do calcs if OBU is called from primary series } else return; // return out if called from another BIP
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Dec 2009
Posts: 102
Thanks: 4
Thanked 0 times in 0 posts
|
so
I just add if (BarsInProgress == 0) { enitre code } Or would I have to add BarsInProgress ==0 to each if statement? I am assuming BarsinProgress 0 is equal to the default period and BarsinProgress 1 to array 1 etc etc |
|
|
|
|
|
#10 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Hello MJUK10,
You just need one BarsInProgress check, and can use multiple if statements within. if (BarsInProgress == 0) { enitre code } Yes, BIP 0 is the series that the strategy is run against. BIP 1 is the first added series.
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#11 | |
|
Senior Member
Join Date: Dec 2009
Posts: 102
Thanks: 4
Thanked 0 times in 0 posts
|
Hi guys. I'm still having small issues with this. Could you give some advice please? Backtestting results are still marginally different when I put the extra arrays into the code. My code is as follow:
Quote:
|
|
|
|
|
|
|
#12 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 90 times in 82 posts
|
MJUK10, can you please post the code you're using so we can test this out?
Austin
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problem with backtesting | worldfxsignals | Version 7 Beta General Questions & Bug Reports | 3 | 03-02-2010 03:26 PM |
| backtesting problem | worldfxsignals | Version 7 Beta General Questions & Bug Reports | 1 | 02-25-2010 09:51 AM |
| backtesting problem | kaywai | Strategy Development | 25 | 12-17-2009 01:06 PM |
| Problem backtesting | spacebalts67 | Strategy Analyzer | 3 | 06-28-2008 09:35 PM |
| Software freezing problem | oriondesign | Miscellaneous Support | 1 | 06-01-2007 09:47 AM |