Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TrailStop is automatically canceled

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

    TrailStop is automatically canceled

    When the order is filled, the TrailStop is canceled automatically, when it has a few ticks in its favor and the Trailstop disappears. I made the strategy in Strategy Builder and in the Stops and Targets part I configured only a SetTrailStop.

    Is there a way to fix the issue of the Trailstop canceling itself automatically?

    Thank you.

    #2
    Hello daying35,

    When you say that the order is filled, what order are you referring to? The targets in the stops and targets page rely on the entries position to remain working, if you have another stop or target that filled it will cancel the other working targets for that position.

    Comment


      #3
      Hello NinjaTrader_Jesse

      My entry order is an EnterLongStopMarket and my exit is a SetTrailStop. When the EnterLongStopMarket is filled the SetTrailStop is activated but immediately cancelled. In the stops and targets page I only have SetTrailStop, no profit target, no stop loss.

      Comment


        #4
        Hello daying35,

        Do you have a small sample of the code that you can provide?

        Could you otherwise check trace orders to see if something is happening surrounding the order handling rules?



        That will put order information in the output window by turning on trace orders.

        Comment


          #5
          Hello NinjaTrader_Jesse

          I added TraceOrders ( TraceOrders = true; ) to my strategy code using NinjaScript Editor, to generate the output in NinjaScript Output. Today I used the strategy again and just like yesterday, the strategy set the trailstop but it was immediately cancelled. I was looking in the NinjaScript Output window for the last line of text that contains information about the canceled trailstop and it is the following (only I edited my account name to keep it private):

          Amended trail stop order orderId='1529606707' account='MYACCOUNT' name='Trail stop' orderState=CancelPending instrument='MNQ 03-23' orderAction=Sell orderType='Stop Market' limitPrice=0 stopPrice=10903.75 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=1295 time='2023-01-05 10:08:27' gtd='2099-12-01' statementDate='2023-01-05' stopPriceChanged=10904.75

          I have saved the .txt file of the information contained in the NinjaScript Output window, if necessary, I will send you the .txt file please tell me.

          Thank you.

          Comment


            #6
            Hello daying35,

            Can you see in the information if the order was trying to be changed before it was canceled? Was it submitted and then also changed and cancelled or was it submitted and then just cancelled?

            Are you also using a profit target along with this trailing stop?

            Comment


              #7
              Hello NinjaTrader_Jesse

              I solved the error. Thank you very much for your help, it was very useful!​

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Yesterday, 05:17 AM
              0 responses
              81 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              149 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              79 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              52 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              59 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X