Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Line Break Strategy

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

    Line Break Strategy

    When backtesting a strategy on a linebreak chart, I have added a minute data series of the same instrument to get correct price fills. When running live and comparing against the backtest, the results are very similar (same number of trades, same direction), however, the trades occur a couple minutes (2-10) later.

    #2
    Hello samish18,

    If the trades are being submitted on different bars that would be one cause where the executions are offset by some period of time. Have you added prints into your entry conditions to make sure they are becoming true on exactly the same bars?

    Comment


      #3
      I am using prints and they are returning the same values. It seems when running live, the executions are delayed by 1-2 bars

      Comment


        #4
        Hello samish18,

        When you say the same values what specifically are you checking? Because you are testing forward in time you can't compare that directly with a historical bar to know the logic happened identically as it previously did, you could still check if your entry condition is becoming true and print the bar time at the time of the entry to see when it was physically submitted. That would be the best way to know if the delay of a few bars would be expected or not, you should be able to see the specific time the condition became true to compare with the chart. If the printed time matches the chart time then the strategy was performing as directed.

        Comment


          #5
          I am printing the time and moving average values of each bar (this is a moving average crossover strategy) I run the strategy live then backtest over the same period and get the same prints

          Comment


            #6
            Hello samish18,

            Are you printing that specifically when the condition became true? it would not be helpful to print that for every bar in this situation because you say there is a delay, you would need to isolate the 1 specific bar where the condition was true and print that time. Does that match the time the order is displayed on the chart?

            Comment


              #7
              The condition become true at the same time between live and backtest, however, orders are still being delayed

              Comment


                #8
                Hello samish18,

                I understand that part from your question, did you try isolating a print in your entry condition to make sure the time shown in the print matches the time where the order is displayed on the chart?

                Comment


                  #9
                  Yes, the time shown in the prints match

                  Comment


                    #10
                    Hello samish18,

                    If the time when the condition was true matches the execution that means that the order is being displayed correctly and is not delayed, the order was submitted and filled shortly after. Historically you should see the executions on the bar following the primary bar close based on how fill processing works and the time that the order will have in relation to the primary bar times.

                    Comment


                      #11
                      I understand that the execution of the order will be on the open of the following bar - this is what occurs in the backtest. During the live run, it executed on the following bars (2-3 bars after the current bar instead of 1).

                      Comment


                        #12
                        Hello samish18,

                        Based on the information you have given that means the condition was true later. If the time you printed from the condition matches the chart there is no delay of bars, that was the bar where the condition happened. If that is different from the backtest that means the condition is happening on a different bar in the backtest.

                        This could also relate to the order type being used, if you are using a order like a limit to enter that will have to wait for the active market to reach that price to fill which could cause a delay in fill but that will be reflected in the print, You would see the print happened at a earlier time than the fill of the execution. From your description it sounds like the condition time matched the fill time so there was no delay in filling.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by NullPointStrategies, Yesterday, 05:17 AM
                        0 responses
                        62 views
                        0 likes
                        Last Post NullPointStrategies  
                        Started by argusthome, 03-08-2026, 10:06 AM
                        0 responses
                        134 views
                        0 likes
                        Last Post argusthome  
                        Started by NabilKhattabi, 03-06-2026, 11:18 AM
                        0 responses
                        75 views
                        0 likes
                        Last Post NabilKhattabi  
                        Started by Deep42, 03-06-2026, 12:28 AM
                        0 responses
                        45 views
                        0 likes
                        Last Post Deep42
                        by Deep42
                         
                        Started by TheRealMorford, 03-05-2026, 06:15 PM
                        0 responses
                        50 views
                        0 likes
                        Last Post TheRealMorford  
                        Working...
                        X