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 NullPointStrategies, Today, 05:17 AM
                0 responses
                50 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                126 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                69 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                42 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                46 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X