Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Executions not match with the Strategy Analyzer

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

    Executions not match with the Strategy Analyzer

    Hi,

    I am writing to you because I am currently testing a strategy, and I have encountered this small issue. I wanted to see if it is possible for you to provide some guidance. I am running the tests on 60-minute ranges. Today, I activated it with test data, and these were the results, including these two specific candles that ended in stop loss:



    These values can also be seen in the execution log, e.g., the execution with the price 21791.5:

    Click image for larger version

Name:	Captura de pantalla 2024-12-13 a la(s) 10.35.21 p.m..png
Views:	56
Size:	995.1 KB
ID:	1327764

    And if I switch the chart to 1-second intervals to see the details of what happened, I can see the prices from the previous images interacting:

    Click image for larger version

Name:	Captura de pantalla 2024-12-13 a la(s) 11.11.52 p.m..png
Views:	45
Size:	145.3 KB
ID:	1327766



    But if I disable and re-enable the strategy, the values are different; for the two candles with a stop, a target now appears:

    Click image for larger version

Name:	Captura de pantalla 2024-12-13 a la(s) 10.40.54 p.m..png
Views:	42
Size:	197.6 KB
ID:	1327767

    When running the Strategy Analyzer, the two trades appear with positive results as well:

    Click image for larger version

Name:	Captura de pantalla 2024-12-13 a la(s) 10.44.19 p.m..png
Views:	43
Size:	472.1 KB
ID:	1327768

    And when viewing the chart in 1-second intervals to see the trade details, it looks like this:

    Click image for larger version

Name:	Captura de pantalla 2024-12-13 a la(s) 11.01.12 p.m..png
Views:	38
Size:	196.6 KB
ID:	1327769


    I’m not sure what might be causing the change in values or if there is an issue with the Strategy Analyzer since the values on the 1-second chart don’t seem correct. I have already used the “Reload All Historical Data” option, but I’m not sure what other option or detail I might be missing.

    Thanks in advance...
    Attached Files

    #2
    Hello steve_mb,

    When comparing realtime and historical results there are some reasons that would cause the strategy to calculate differently. While we would be unable to provide an exact answer of why that is with your custom strategy you can debug the strategy to find out the exact answer. Because every strategy is different there is not one single answer as to why that would be different, that heavily depends on the settings you used and how the strategy was coded.

    We have a guide linked below that goes over how you can add debugging to the strategy to explore differences between tests. The guide goes over comparing historical and realtime which is what you explained.

    This page lists some common items which will cause differences between realtime and historical, you can use this page to see if any of these apply to your use case:
    https://ninjatrader.com/support/helpGuides/nt8/discrepancies_real-time_vs_bac.htm

    This guide goes over how to add debugging and then compare results. The short summary is that you add prints into your code and then collect the output after running the strategy in realtime. Then restart the strategy so it processes historically and then collect those prints as well. You can then compare the prints to see how the strategy logically worked in both use cases. Based on your observations you can make any changes needed to have the strategy results become more close to realtime.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    116 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    61 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    40 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    43 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    82 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X