Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting a single day vs backtesting 2+ days have different results

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

    Backtesting a single day vs backtesting 2+ days have different results

    This is pretty weird.
    I wanted to test how my strategy would have done on a specific day last week (March 18th). The strategy was 100% profitable for a given stock last week. To my surprise when I selected March 18th - March 18th, with the same settings as the longer run, It lost the only trade that day???

    I looked at the charts and found this.

    The chart type is Heiken Ashi (Im not sure if that could impact it).

    Any time I run it for a single day there are almost no trades, or they are much more likely to lose. If I run it over any period of days it performs as expected. My code does not look back at previous bars. I set the barsRequiredToTrade to 0. I am using VMA, but not sure if that would cause this bug.

    It performs pretty poorly when run on a specific day. I am wondering if it will behave this way or as expected when I run this live. Has anyone seen this bug?

    #2
    Hello Gathem,

    Thank you for your post.

    We would expect that running a strategy over different data may give differering results. Strategies that are started at different times can calculate differently as they're iterating over different amounts of data which can affect indicator values. Without seeing your code, it'd be pretty difficult to establish what exactly within the strategy would calculate differently if run over a single day vs. multiple days, however. If you can supply a code snippet that may be able to give us a better idea of what's going on.

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sidlercom80, 10-28-2023, 08:49 AM
    173 responses
    2,363 views
    0 likes
    Last Post jeronymite  
    Started by Mindset, Today, 10:38 PM
    0 responses
    7 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by JesseOffshore, Today, 09:40 PM
    0 responses
    4 views
    0 likes
    Last Post JesseOffshore  
    Started by WHICKED, 04-26-2024, 12:56 PM
    4 responses
    141 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by ezrollin, 02-26-2022, 11:14 PM
    7 responses
    207 views
    0 likes
    Last Post kenz987
    by kenz987
     
    Working...
    X