Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stoploss and Takeprofit in the same Candle

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

    Stoploss and Takeprofit in the same Candle

    In the backtest, when I have SL and TP in the same candle , which one will be execute first?

    #2
    Hello wagner4691,

    Thanks for your post.

    The stoploss would always been taken in that situation.

    Comment


      #3
      So even if the candle goes up above your set TP and then back down at or below your SL it will always execute the SL first? That seems wrong.

      Comment


        #4
        Hello ATMtrader0001,

        Thanks for your reply.

        In backtesting the only information available to the strategy analyzer is the OHLC data points of the bar, it does not know if the bar goes up or down first/last, just its finished form. When both SL and PT can be hit in the same bar, conservatively, the SL will be taken.

        Comment


          #5
          I missed the backtest part. My mistake.

          Comment


            #6
            Originally posted by marcus2300

            You will have to correct it manually in your report. Watch in a smaller timeframe and you will see in which order things happened.
            You should always be very careful with backtesting or replay.

            For instance if you use replay, depending of the speed the signal will give a different price. If the speed is 1, every second the signal will be checked; if you put the speed at 50, every 50 seconds the signal will be checked. Checking always happens at the close of the timeframe you use. So in 50 seconds your signal can in reality have any price in this 50 second period, but it will use the price at the end of the 50 second period. So result can be very wrong when volatility is high.
            This is wrong?? Replay calculates each tick if the strat/indicator does. When a signal occurs on a certain tick it will be on that tick no matter what speed you use to play.
            eDanny
            NinjaTrader Ecosystem Vendor - Integrity Traders

            Comment


              #7
              Hello marcus2300,

              Thanks for your post.

              It appears you are using Chart Alerts in Playback. Please note this information in the help guide: "2) Alerts are not intended to be used with Playback while using an increased speed. Alerts are checked every 200 milliseconds, so using them in Playback could result in an alert not triggering."

              Reference: https://ninjatrader.com/support/help...ing_alerts.htm

              Comment


                #8
                Hello marcus2300,

                Thanks for your reply.

                Correct, if you are using/testing alerts in playback you can only go at real time speed as specified in the help guide note.

                I have no knowledge of Tickrefresh app so I would be unable to advise.

                If you generate a signal from Ninjascript (strategy or indicator) you would not have that timer limitation as it would process according to the bars.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Mindset, 04-21-2026, 06:46 AM
                0 responses
                87 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by M4ndoo, 04-20-2026, 05:21 PM
                0 responses
                132 views
                0 likes
                Last Post M4ndoo
                by M4ndoo
                 
                Started by M4ndoo, 04-19-2026, 05:54 PM
                0 responses
                68 views
                0 likes
                Last Post M4ndoo
                by M4ndoo
                 
                Started by cmoran13, 04-16-2026, 01:02 PM
                0 responses
                118 views
                0 likes
                Last Post cmoran13  
                Started by PaulMohn, 04-10-2026, 11:11 AM
                0 responses
                67 views
                0 likes
                Last Post PaulMohn  
                Working...
                X