Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Fix your system

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

    Fix your system

    There is absolutely no relationship between the strategy analyzer and running in the live environment - fix this immediately. When running a strategy live and then backtesting over the same period, the results are completely different.

    #2
    Hello samish18,

    There are many reasons why you could see differences between a historical and a realtime test which are based on data, the settings your strategy uses and also how the strategy is coded. You can find details of common discrepancies in the link below, the second and third links go over how you can investigate differences by debugging the strategy in both use cases. Not all strategies are equal so some may show closer results to realtime than others and some strategies may not be able to produce accurate historical results at all depending on the specific situation. Without specific details on the settings used and how the strategy was coded the best first step is to go over the pages below so you can identify any items that may cause differences in your unique strategy.



    Comment


      #3
      I am using OnBarClose and 5 minutes bars and market orders - I should not see certain trades occurring live but not in backtest and vice versa

      Comment


        #4
        Hello samish18,

        That would not be enough detail to know why you are seeing differences.

        You could have differences for many reasons, some could include the start point of the data which could cause differences in how conditions evaluate or how indicator values are calculated. If there are any differences in starting points for data you are likely going to see differences. Fills can also be different, the simulator can simulate fills however in a real market when using market orders you can see different amounts of slippage which can cause differences in fill prices. If you are seeing amounts of slippage you can optionally enter that amount of slippage in the backtest to simulate that.

        In general for a backtest to be similar to a realtime test everything needs to be exactly identical. The data start point would need to be identical so you have exactly the same amount of data loaded in each test. You generally would only be able to compare those tests after the realtime session has closed and you have collected the results from the realtime test, you can then set up a backtest to have exactly the same data startpoint as you did in the realtime test and go from there. The purpose of the links I provided is so you can add debugging into the script to confirm these type of items.

        The best first step is to go over the pages I had linked and identify anything that can be different between your tests. You can look at executions in the backtest and then compare that to the identical timeframe from a realtime test to see if its just the execution prices that are different or if they are happening on different bars, that will give you an idea if the difference is related to fills or logical/settings/data differences.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        20 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        119 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        63 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        45 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X