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 geddyisodin, Today, 05:20 AM
    0 responses
    3 views
    0 likes
    Last Post geddyisodin  
    Started by JonesJoker, 04-22-2024, 12:23 PM
    6 responses
    33 views
    0 likes
    Last Post JonesJoker  
    Started by GussJ, 03-04-2020, 03:11 PM
    12 responses
    3,239 views
    0 likes
    Last Post Leafcutter  
    Started by AveryFlynn, Today, 04:57 AM
    0 responses
    6 views
    0 likes
    Last Post AveryFlynn  
    Started by RubenCazorla, 08-30-2022, 06:36 AM
    3 responses
    79 views
    0 likes
    Last Post PaulMohn  
    Working...
    X