NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 11-26-2008, 04:16 PM   #1
heech
Senior Member
 
Join Date: Nov 2008
Posts: 576
Thanks: 0
Thanked 1 time in 1 post
Default Strange back-test results..

Hi there,

This is probably going to be one of those issues that you guys won't be able to help me on... but I thought I'd throw it out there and know if you guys had any input.

I have two versions of code that I'm running on the same symbol. The results of the backtest (identical parameters) *look* the same, but aren't. Here's what I mean:

Quote:
Backtest 1
1 IOC Back101 ProtectDown Long 1,000 13.19 13.11 10/30/2008 12:30:00 PM 10/30/2008 12:30:00 PM Buy Sell -0.0064442759666413253 -0.0064442759666413219 0 0.0064442759666413253 0 0 1
2 IOC Back101 ProtectDown Long 1,000 14.06 12.93 10/31/2008 8:00:00 AM 11/6/2008 7:00:00 AM Buy Sell -0.0803698435277382 -0.08629619404329103 0 0.0803698435277382 0.10170697012802288 0.18207681365576106 51
3 IOC Back101 ProtectDown Long 1,000 13.37 13.11 11/10/2008 8:30:00 AM 11/10/2008 8:30:00 AM Buy Sell -0.019820493642483082 -0.10440625452036856 0 0.019820493642483082 0 0 1
4 IOC Back101 ProtectDown Long 1,000 13.85 13.26 11/10/2008 12:00:00 PM 11/11/2008 6:40:00 AM Buy Sell -0.042599277978339338 -0.14255790143971747 0 0.043321299638989147 0 0 4
Quote:
Backtest #2
1 IOC Back101 ProtectDown Long 1,000 13.19 13.11 10/30/2008 12:30:00 PM 10/30/2008 12:30:00 PM Buy Stop loss -0.0060652009097800072 -0.0060652009097800219 0 0.0060652009097800072 0 0 1
2 IOC Back101 ProtectDown Long 1,000 14.06 12.93 10/31/2008 8:00:00 AM 11/6/2008 7:00:00 AM Buy Sell -0.0803698435277382 -0.0859475851894349 0 0.0803698435277382 0.10170697012802288 0.18207681365576106 51
3 IOC Back101 ProtectDown Long 1,000 13.37 13.11 11/10/2008 8:30:00 AM 11/10/2008 8:30:00 AM Buy Stop loss -0.019446522064322964 -0.10372272564199625 0 0.019446522064322964 0 0 1
4 IOC Back101 ProtectDown Long 1,000 13.85 13.26 11/10/2008 12:00:00 PM 11/11/2008 6:40:00 AM Buy Sell -0.042599277978339338 -0.14190349039804107 0 0.043321299638989147 0 0 4
The part that's absolutely confusing me is why the "profit" column are slightly different in these two executions (0.006444.. in backtest 1 versus 0.00606.. in backtest 2), when the price/timing of entry/exit are exactly/absolutely the same.

This is repeatable, and tied to my two versions of code. The changes between the two versions are really minor (nothing obvious, like commissions or slippage or...)... there's one of the two that I prefer, but I can't figure out where in my logic I'm leading to this difference in "profit".
heech is offline  
Reply With Quote
Old 11-26-2008, 04:53 PM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Hi heech,

Hard to judge, there could be multiple scenarios at play...

1. Make sure you test both versions under the exact same settings and conditions.

2. Use the Print() command to debug and see if your trading logic hits home, see this thread here, too - http://www.ninjatrader-support2.com/...ead.php?t=3418

3. Make sure you test with the same fill algorithm - http://www.ninjatrader-support.com/H...AStrategy.html
See under 'Historical Fill processing'

Have a good Thanksgiving!
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 11-26-2008, 05:26 PM   #3
heech
Senior Member
 
Join Date: Nov 2008
Posts: 576
Thanks: 0
Thanked 1 time in 1 post
Default

Hi Bertrand,

I think I decided what the issue is. In both cases, the difference came when a stop was hit in the same bar as the entry. I think I must've very subtly changed the timing (in the backtest) of when the stop loss is placed... perhaps not even something on the scale of many minutes? 30 seconds? Who knows.

Thanks for looking at it.
heech is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Target prices Work in Back Test but fail on simulator metal trader Automated Trading 5 10-27-2008 09:03 AM
Possible to Back Test Whilst Offline? pmn100 Strategy Analyzer 4 08-21-2008 04:26 AM
Strange effect Burga1 Strategy Development 5 05-16-2008 11:08 PM
Realistic Back-Test MGDavid Strategy Development 9 07-24-2007 04:27 AM
back test latkinso Automated Trading 5 05-18-2007 11:58 AM


All times are GMT -6. The time now is 07:45 PM.