Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why is my stoploss getting canceled here?

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

    #16
    I downloaded and installed the RC1 version. So far so good... no problems. I will let you know if it comes up again. Thanks for the help!

    Bryan

    Comment


      #17
      Hey, I got it to happen again. I think I figured it out. What's happening is that my script is erroneously calling SetStopLoss() a second time using the same stop price. The second time it's called is when you get the "Expired" error and the stop is removed from the chart.

      Here is the output when it happened this time (using V7.0 RC1):

      10/20/2010 3:54:29 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=701.2 Currency=0 Simulated=False
      10/20/2010 3:54:29 PM Amended stop order: Order='58d6314b8a294a38a0d651e2c755cb81/Replay101' Name='Stop loss' State=Accepted Instrument='TF 12-10' Action=BuyToCover Limit price=0 Stop price=701.2 Quantity=1 Strategy=' ptt Strategy Builder' Type=Stop Tif=Day Oco='e4cc61fe6fbb42998448ea2c26d4fdb1-779' Filled=0 Fill price=0 Token='58d6314b8a294a38a0d651e2c755cb81' Gtd='12/1/2099 12:00:00 AM'

      [a tick happens here....below is when OnBarUpdate is called for this next tick]

      Order='58d6314b8a294a38a0d651e2c755cb81/Replay101' Name='Stop loss' State=PendingChange Instrument='TF 12-10' Action=BuyToCover Limit price=0 Stop price=701.2 Quantity=1 Type=Stop Tif=Day OverFill=False Oco='e4cc61fe6fbb42998448ea2c26d4fdb1-779' Filled=0 Fill price=0 Token='58d6314b8a294a38a0d651e2c755cb81' Gtd='1/1/0001 12:00:00 AM'
      Order='58d6314b8a294a38a0d651e2c755cb81/Replay101' Name='Stop loss' State=Accepted Instrument='TF 12-10' Action=BuyToCover Limit price=0 Stop price=701.2 Quantity=1 Type=Stop Tif=Day OverFill=False Oco='e4cc61fe6fbb42998448ea2c26d4fdb1-779' Filled=0 Fill price=0 Token='58d6314b8a294a38a0d651e2c755cb81' Gtd='1/1/0001 12:00:00 AM'
      10/20/2010 3:54:29 PM Cancelled expired order: BarsInProgress=0: Order='58d6314b8a294a38a0d651e2c755cb81/Replay101' Name='Stop loss' State=Accepted Instrument='TF 12-10' Action=BuyToCover Limit price=0 Stop price=701.2 Quantity=1 Strategy=' ptt Strategy Builder' Type=Stop Tif=Day Oco='e4cc61fe6fbb42998448ea2c26d4fdb1-779' Filled=0 Fill price=0 Token='58d6314b8a294a38a0d651e2c755cb81' Gtd='12/1/2099 12:00:00 AM'
      Order='58d6314b8a294a38a0d651e2c755cb81/Replay101' Name='Stop loss' State=PendingCancel Instrument='TF 12-10' Action=BuyToCover Limit price=0 Stop price=701.2 Quantity=1 Type=Stop Tif=Day OverFill=False Oco='e4cc61fe6fbb42998448ea2c26d4fdb1-779' Filled=0 Fill price=0 Token='58d6314b8a294a38a0d651e2c755cb81' Gtd='1/1/0001 12:00:00 AM'
      Order='58d6314b8a294a38a0d651e2c755cb81/Replay101' Name='Stop loss' State=Cancelled Instrument='TF 12-10' Action=BuyToCover Limit price=0 Stop price=701.2 Quantity=1 Type=Stop Tif=Day OverFill=False Oco='e4cc61fe6fbb42998448ea2c26d4fdb1-779' Filled=0 Fill price=0 Token='58d6314b8a294a38a0d651e2c755cb81' Gtd='1/1/0001 12:00:00 AM'
      Order='bea98471c5c64f8cb4d287cc3c0ed4e8/Replay101' Name='Profit target' State=PendingCancel Instrument='TF 12-10' Action=BuyToCover Limit price=696.7 Stop price=0 Quantity=1 Type=Limit Tif=Day OverFill=False Oco='e4cc61fe6fbb42998448ea2c26d4fdb1-779' Filled=0 Fill price=0 Token='bea98471c5c64f8cb4d287cc3c0ed4e8' Gtd='1/1/0001 12:00:00 AM'
      Order='bea98471c5c64f8cb4d287cc3c0ed4e8/Replay101' Name='Profit target' State=Cancelled Instrument='TF 12-10' Action=BuyToCover Limit price=696.7 Stop price=0 Quantity=1 Type=Limit Tif=Day OverFill=False Oco='e4cc61fe6fbb42998448ea2c26d4fdb1-779' Filled=0 Fill price=0 Token='bea98471c5c64f8cb4d287cc3c0ed4e8' Gtd='1/1/0001 12:00:00 AM'

      Comment


        #18
        cassb,

        I suggest adding a lot more granular printouts to your code to find out exactly which line your strategy ends up processing. I suggest you using Print()s to isolate if your suspected cause is truly the cause.
        Josh P.NinjaTrader Customer Service

        Comment


          #19
          I was wrong Josh, sorry. It's not calling the SetStopLoss() method twice for the same price. I was confused on the difference between the TraceOrders output:

          10/20/2010 3:54:29 PM Amended stop order: Order='58d6314b8a294a38a0d651e2c755cb81/Replay101' Name='Stop loss' State=Accepted Instrument='TF 12-10' Action=BuyToCover Limit price=0 Stop price=701.2 Quantity=1 Strategy=' ptt Strategy Builder' Type=Stop Tif=Day Oco='e4cc61fe6fbb42998448ea2c26d4fdb1-779' Filled=0 Fill price=0 Token='58d6314b8a294a38a0d651e2c755cb81' Gtd='12/1/2099 12:00:00 AM'

          and the OnOrderUpdate() output:

          Order='58d6314b8a294a38a0d651e2c755cb81/Replay101' Name='Stop loss' State=Accepted Instrument='TF 12-10' Action=BuyToCover Limit price=0 Stop price=701.2 Quantity=1 Type=Stop Tif=Day OverFill=False Oco='e4cc61fe6fbb42998448ea2c26d4fdb1-779' Filled=0 Fill price=0 Token='58d6314b8a294a38a0d651e2c755cb81' Gtd='1/1/0001 12:00:00 AM'

          I think we still have a problem, and I think it's in the internal Ninja code somewhere. Can you tell me where in your code would trigger the TraceOrders to output the line:

          10/20/2010 3:54:29 PM Cancelled expired order: BarsInProgress=0: Order='58d6314b8a294a38a0d651e2c755cb81/Replay101' Name='Stop loss' State=Accepted Instrument='TF 12-10' Action=BuyToCover Limit price=0 Stop price=701.2 Quantity=1 Strategy=' ptt Strategy Builder' Type=Stop Tif=Day Oco='e4cc61fe6fbb42998448ea2c26d4fdb1-779' Filled=0 Fill price=0 Token='58d6314b8a294a38a0d651e2c755cb81' Gtd='12/1/2099 12:00:00 AM'

          Comment


            #20
            An expired order is any order that is not kept alive. Unfortunately there are no real hints I can provide you as we would have no idea what your code actually looks like. What I suggest is using Print() liberally along with TraceOrder to fully understand what is happening along each step of the way and also removing all unnecessary parts of your code and try to isolate out the behavior by stripping it down to bare bones.
            Josh P.NinjaTrader Customer Service

            Comment


              #21
              Originally posted by NinjaTrader_Josh View Post
              An expired order is any order that is not kept alive. Unfortunately there are no real hints I can provide you as we would have no idea what your code actually looks like. What I suggest is using Print() liberally along with TraceOrder to fully understand what is happening along each step of the way and also removing all unnecessary parts of your code and try to isolate out the behavior by stripping it down to bare bones.
              Hi, I had a problem today with a partial cancellation of my stop loss order. I was trading 30 NQ 12/10 contracts long. I hit the stop loss and 10 contracts were sold, but the stop loss for the other 20 contracts were cancelled. Is this an NT problem or a broker problem? This is the first time this has ever happened. Also, this is the first time I hit the stop loss trading more than 10 contracts.

              Alan Kline
              Last edited by klineal; 11-01-2010, 10:48 PM.

              Comment


                #22
                Alan, we would need to review your trace & log diagnostic files for this case - could you please send them in via the Help > Mail to Support feature?

                Thanks

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                633 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                364 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                105 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                567 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                568 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X