Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strange back-test results..

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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:

    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
    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".

    #2
    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!

    Comment


      #3
      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.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      574 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      333 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X