Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop‑Limit Orders Rejected due to Invalid Price

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

    Stop‑Limit Orders Rejected due to Invalid Price

    Dear Ninja Community,
    I am working on an automated trading strategy that includes a trailing reversal order set at a specific price. My strategy calculates on each tick and I am testing it in market replay. The issue I’m having is that in certain volatile moments the strategy will close and give me this error message:
    ​​
    I have dealt with this problem in the past and simply implemented a check before the order is submitted to make sure we are not submitting a buystop above the ask and a sellstop below the bid. So I did this too in this code block in OnBarUpdate for short and long orders: * One note here is that the order submission code block only executes if the reversal order changes price hence the: (reversalPrice-currentReversalPrice) >=TickSize. This needs to happen so that the order isn’t always executed based on the bid/ask safety fallback.
    Click image for larger version

Name:	Main Code Block.png
Views:	198
Size:	442.4 KB
ID:	1340587​​

    However, it did not solve the problem. I tried adding additional checks or additional fallbacks in the OnOrderUpdate but nothing seemed to work. Here is also my log leading up to the error:
    Click image for larger version

Name:	Debug Output.png
Views:	199
Size:	143.0 KB
ID:	1340588

    You can see that the safety check approves the order submission because the current ask is 267.75 which is below the reversalPrice. Then somewhere in-between that approval the price moves away and the order is rejected. Attached is also the bid/ask for these ticks and you can see the spread widens at that moment, but there should be many ticks where the order can be submitted: Time: 9:45 AM, Bid: 20261.75, Ask: 20267.75
    Time: 9:45 AM, Bid: 20261.75, Ask: 20268
    Time: 9:45 AM, Bid: 20262.5, Ask: 20268
    Time: 9:46 AM, Bid: 20262.5, Ask: 20267.75 - Here the bar changes and the new order is submitted
    Time: 9:46 AM, Bid: 20262.5, Ask: 20268
    Time: 9:46 AM, Bid: 20262.5, Ask: 20268
    Time: 9:46 AM, Bid: 20262.5, Ask: 20271.75
    Time: 9:46 AM, Bid: 20262.5, Ask: 20271.75
    Time: 9:46 AM, Bid: 20262.5, Ask: 20274.75
    Time: 9:46 AM, Bid: 20262.5, Ask: 20275
    Time: 9:46 AM, Bid: 20262.5, Ask: 20275
    Time: 9:46 AM, Bid: 20262.5, Ask: 20275
    Time: 9:46 AM, Bid: 20262.5, Ask: 20275
    Time: 9:46 AM, Bid: 20262.5, Ask: 20275.75
    Time: 9:46 AM, Bid: 20262.5, Ask: 20276
    Time: 9:46 AM, Bid: 20262.5, Ask: 20276.25
    Time: 9:46 AM, Bid: 20262.5, Ask: 20283.75
    Interestingly, the bid stays the same the whole time, so I wonder if it doesn’t register as a “tick”.
    If anyone has any ideas for solving this problem, I would be extremely grateful.
    Attached Files
    Last edited by Jonasdvs12; 04-14-2025, 10:31 AM.

    #2
    Hello Jonasdvs12,

    A buy stop order must have the stop price above the ask, a sell stop order must have the stop price below the bid.


    Calling ExitShort() and then EnterLong() on the same bar update will cause an overfill error or will double the quantity of the position in the opposite direction.


    Just call the entry without calling the exit to reverse the position.

    Orders should not be assigned to variables from the order method. Orders should be assigned to variables from the order parameter of OnOrderUpdate().
    "OnOrderUpdate() will run inside of order methods such as EnterLong() or SubmitOrderUnmanaged(), therefore attempting to assign an order object outside of OnOrderUpdate() may not return as soon as expected. If your strategy is dependent on tracking the order object from the very first update, you should try to match your order objects by the order.Name (signal name) from during the OnOrderUpdate() as the order is first updated."
    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,
      Thanks for the quick reply, I made the changes you recommended in regards to the overfill error. But I am still getting the Order can't be placed below the market. I misspoke in my original post my code currently does check and makes sure that the buy stop order is not submitted below the ask and if the ask is above the order we enter with a market order (And vice versa for sell stops) as you can see here in my code:
      Click image for larger version

Name:	Screenshot 2025-04-14 at 1.47.09 PM.png
Views:	193
Size:	522.1 KB
ID:	1340603
      Here is the debug Output:
      Click image for larger version

Name:	Screenshot 2025-04-14 at 1.51.02 PM.png
Views:	184
Size:	154.4 KB
ID:	1340605
      You can see that code checks and approves the order submission, it does not catch that the order entry reversalPrice is below the ask.Why does this happen even though I have the check to make sure?
      Attached Files

      Comment


        #4
        Hello Jonasdvs12,

        For a buy stop limit, the limit price needs to be equal to or greater than the stop price. For a sell stop limit the limit price needs to be equal to or less than the stop price.

        It looks like you may be submitting the limit price below the stop price for the buy stop order.

        Also, this is from an order change and not from the initial submission?


        Further, I recommend adding the following print as the first line in the OnOrderUpdate() logic block to get a better sense of what is occurring.

        Print(string.Format("{0} | GetCurrentAsk(): {1}, GetCurrentBid(): {2} | {3}", order.Time, GetCurrentAsk(), GetCurrentBid(), order));

        This should be the first line, outside of any conditions. Use this with RealtimeErrorHandling.IgnoreAllErrors so that we can get information about rejections.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Yes this is from an order change. The reversal price changes at the close of the 9:45 bar and so then adjusts the order due to the reversal price changing.

          === Bar 5085, Time = 3/24/2025 9:46:00 AM ===

          [DEBUG] Short Tick: tradeExtreme = 20247.00, prevVolFactor = 23.43

          [DEBUG] Short Tick: CandidateA = 20293.25 (from lockedPrevTradeExtremeLong), CandidateB = 20282.25

          [DEBUG] Short Tick: tradeCycleAgreement = True -> reversalPrice = 20282.25

          3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='629a57988f33476fa8ba34e3b127028f' account='Playback101' name='Close position' orderState=Working instrument='NQ 06-25' orderAction=BuyToCover orderType='Stop Limit' limitPrice=20280.5 stopPrice=20280.25 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=18934 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'

          3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='e2dfd41ef4fb484284edafaa822deed2' account='Playback101' name='ReversalLong' orderState=Working instrument='NQ 06-25' orderAction=Buy orderType='Stop Limit' limitPrice=20280.5 stopPrice=20280.25 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=18935 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'

          === Bar 5085, Time = 3/24/2025 9:46:00 AM ===

          [DEBUG] Short Tick: tradeExtreme = 20247.00, prevVolFactor = 23.43

          [DEBUG] Short Tick: CandidateA = 20293.25 (from lockedPrevTradeExtremeLong), CandidateB = 20282.25

          [DEBUG] Short Tick: tradeCycleAgreement = True -> reversalPrice = 20282.25

          3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='629a57988f33476fa8ba34e3b127028f' account='Playback101' name='Close position' orderState=Filled instrument='NQ 06-25' orderAction=BuyToCover orderType='Stop Limit' limitPrice=20280.5 stopPrice=20280.25 quantity=1 tif=Gtc oco='' filled=1 averageFillPrice=20280.25 onBehalfOf='' id=18934 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'

          3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='e2dfd41ef4fb484284edafaa822deed2' account='Playback101' name='ReversalLong' orderState=Filled instrument='NQ 06-25' orderAction=Buy orderType='Stop Limit' limitPrice=20280.5 stopPrice=20280.25 quantity=1 tif=Gtc oco='' filled=1 averageFillPrice=20280.25 onBehalfOf='' id=18935 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'

          [DEBUG] Reversal to LONG; lockedPrevTradeExtremeShort = 20247.00


          I realize this is a lot to sift through, but I am really just stuck. It seems that the script is identifying the current ask as 20267.75, but then when it submits the order there is some sort of delay or sequencing issue. Because it is still not accepted. But then it is accepted 1 tick later but not after rejecting the initial order. So if I have error handling off then it will continue but with error handling enabled the strategy will be closed. It's all very confusing. I am very thankful for you taking the time to help me out Chelsea!
          Last edited by Jonasdvs12; 04-14-2025, 01:47 PM. Reason: I copied the wrong output in here, the new one is much more concise

          Comment


            #6
            Hello Jonasdvs12,

            The change of errorhandling was so that the strategy can continue running and print output about order rejections which is not included in the output you have posted.

            Please right-click the output window, select Save as, and attach the output file to your next post so we can follow the full output along with the order rection or unable to change order rejection.

            The output you have provided is only two orders, Close position and ReversalLong, were working and then filled. No issue is shown here.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              I apologize for that, it was my mistake. I attached the output with the print statements. To speed up your search through it, the order we are looking at is when the bar changes from 5084 to 5085. And here is the ninja log:
              Time Category Message
              4/14/25 17:35 Order Order='136a3b8f3eaf4b62ada4026194c98e7e/Playback101' Name='ReversalShort' New state='Accepted' Instrument='NQ 06-25' Action='Sell short' Limit price=20246.75 Stop price=20247 Quantity=1 Type='Stop Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
              4/14/25 17:35 Order Order='136a3b8f3eaf4b62ada4026194c98e7e/Playback101' Name='ReversalShort' New state='Submitted' Instrument='NQ 06-25' Action='Sell short' Limit price=20246.75 Stop price=20247 Quantity=1 Type='Stop Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
              4/14/25 17:35 NinjaScript NinjaScript strategy 'CycleDetectorStrategy/353544180' submitting order
              4/14/25 17:35 Order Order='0cffb79220b6424c8c3c7437ea967626/Playback101' Name='Close position' New state='Accepted' Instrument='NQ 06-25' Action='Sell' Limit price=20246.75 Stop price=20247 Quantity=1 Type='Stop Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
              4/14/25 17:35 Order Order='0cffb79220b6424c8c3c7437ea967626/Playback101' Name='Close position' New state='Submitted' Instrument='NQ 06-25' Action='Sell' Limit price=20246.75 Stop price=20247 Quantity=1 Type='Stop Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
              4/14/25 17:35 NinjaScript NinjaScript strategy 'CycleDetectorStrategy/353544180' submitting order
              4/14/25 17:35 Position Instrument='NQ 06-25' Account='Playback101' Average price=20280.75 Quantity=1 Market position=Long Operation=Operation_Add
              4/14/25 17:35 Execution Execution='8034fd79cf3048afb3d5e3e9785182e5' Instrument='NQ 06-25' Account='Playback101' Exchange=Default Price=20280.75 Quantity=1 Market position=Long Operation=Operation_Add Order='c74fcc5d529f43688fdb0cc0845a20f8' Time='3/24/2025 9:45 AM'
              4/14/25 17:35 Order Order='c74fcc5d529f43688fdb0cc0845a20f8/Playback101' Name='ReversalLong' New state='Filled' Instrument='NQ 06-25' Action='Buy' Limit price=20280.75 Stop price=20280.5 Quantity=1 Type='Stop Limit' Time in force=GTC Oco='' Filled=1 Fill price=20280.75 Error='No error' Native error=''
              4/14/25 17:35 Position Instrument='NQ 06-25' Account='Playback101' Average price=0 Quantity=0 Market position=Flat Operation=Remove
              4/14/25 17:35 Execution Execution='3c92f915d64e433fae3314e33e57c7b2' Instrument='NQ 06-25' Account='Playback101' Exchange=Default Price=20280.75 Quantity=1 Market position=Long Operation=Operation_Add Order='8645092dc07f429d8467009dbaa270ac' Time='3/24/2025 9:45 AM'
              4/14/25 17:35 Order Order='8645092dc07f429d8467009dbaa270ac/Playback101' Name='Close position' New state='Filled' Instrument='NQ 06-25' Action='Buy to cover' Limit price=20280.75 Stop price=20280.5 Quantity=1 Type='Stop Limit' Time in force=GTC Oco='' Filled=1 Fill price=20280.75 Error='No error' Native error=''
              4/14/25 17:35 Order Order='c74fcc5d529f43688fdb0cc0845a20f8/Playback101' Name='ReversalLong' New state='Working' Instrument='NQ 06-25' Action='Buy' Limit price=20280.75 Stop price=20280.5 Quantity=1 Type='Stop Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
              4/14/25 17:35 Order Order='8645092dc07f429d8467009dbaa270ac/Playback101' Name='Close position' New state='Working' Instrument='NQ 06-25' Action='Buy to cover' Limit price=20280.75 Stop price=20280.5 Quantity=1 Type='Stop Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
              4/14/25 17:35 Order Playback101 Stop price can't be changed below the market. affected Order: Buy 1 StopLimit @ 20280.5 x 20280.75
              4/14/25 17:35 Order Order='c74fcc5d529f43688fdb0cc0845a20f8/Playback101' Name='ReversalLong' New state='Accepted' Instrument='NQ 06-25' Action='Buy' Limit price=20280.75 Stop price=20280.5 Quantity=1 Type='Stop Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='Unable to change order' Native error='Stop price can't be changed below the market.'
              4/14/25 17:35 Order Order='c74fcc5d529f43688fdb0cc0845a20f8/Playback101' Name='ReversalLong' New state='Change submitted' Instrument='NQ 06-25' Action='Buy' Limit price=20282.25 Stop price=20282 Quantity=1 Type='Stop Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
              4/14/25 17:35 Order Playback101 Stop price can't be changed below the market. affected Order: BuyToCover 1 StopLimit @ 20280.5 x 20280.75

              What is interesting is that now the error message reverences that the stop price can't be "changed" below the market. Before it was referencing that the stop price can't be "submitted" so something has shifted.
              Attached Files

              Comment


                #8
                Hello Jonasdvs12,

                I'm not actually finding any of these order ids in the output.

                In the output where I see Bar 5085
                [DEBUG] newBar => updated prevVolFactor = 23.43
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                [DEBUG] cycle classification => bar = 5084, bclass = out
                [DEBUG] new cycleDownMin = 20247 => bar 5084 => madeNewCycleLow
                [DEBUG] CANCEL pendingUp => barLow <= pendUpSwingLow => reset
                [DEBUG] Safety Check SHORT: reversalPrice = 20282.25, currentAsk = 20267.75
                [DEBUG] Short Tick: Submitting reversal stop-limit order with stop = 20282.25 and limit = 20282.50
                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='fb0e49a579594341b1b5cbfa46e0ca5f' account='Playback101' name='Close position' orderState=ChangePending instrument='NQ 06-25' orderAction=BuyToCover orderType='Stop Limit' limitPrice=20280.5 stopPrice=20280.25 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=18977 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'
                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='fb0e49a579594341b1b5cbfa46e0ca5f' account='Playback101' name='Close position' orderState=ChangeSubmitted instrument='NQ 06-25' orderAction=BuyToCover orderType='Stop Limit' limitPrice=20282.25 stopPrice=20282 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=18977 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'
                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='fb0e49a579594341b1b5cbfa46e0ca5f' account='Playback101' name='Close position' orderState=Accepted instrument='NQ 06-25' orderAction=BuyToCover orderType='Stop Limit' limitPrice=20280.5 stopPrice=20280.25 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=18977 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'
                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='1d7d18ba2e404aa4b64ef185a86fb5d7' account='Playback101' name='ReversalLong' orderState=ChangePending instrument='NQ 06-25' orderAction=Buy orderType='Stop Limit' limitPrice=20280.5 stopPrice=20280.25 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=18978 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'
                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='1d7d18ba2e404aa4b64ef185a86fb5d7' account='Playback101' name='ReversalLong' orderState=ChangeSubmitted instrument='NQ 06-25' orderAction=Buy orderType='Stop Limit' limitPrice=20282.25 stopPrice=20282 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=18978 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'
                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='1d7d18ba2e404aa4b64ef185a86fb5d7' account='Playback101' name='ReversalLong' orderState=Accepted instrument='NQ 06-25' orderAction=Buy orderType='Stop Limit' limitPrice=20280.5 stopPrice=20280.25 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=18978 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='fb0e49a579594341b1b5cbfa46e0ca5f' account='Playback101' name='Close position' orderState=Working instrument='NQ 06-25' orderAction=BuyToCover orderType='Stop Limit' limitPrice=20280.5 stopPrice=20280.25 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=18977 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'
                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='1d7d18ba2e404aa4b64ef185a86fb5d7' account='Playback101' name='ReversalLong' orderState=Working instrument='NQ 06-25' orderAction=Buy orderType='Stop Limit' limitPrice=20280.5 stopPrice=20280.25 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=18978 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='fb0e49a579594341b1b5cbfa46e0ca5f' account='Playback101' name='Close position' orderState=Filled instrument='NQ 06-25' orderAction=BuyToCover orderType='Stop Limit' limitPrice=20280.5 stopPrice=20280.25 quantity=1 tif=Gtc oco='' filled=1 averageFillPrice=20280.25 onBehalfOf='' id=18977 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'
                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='1d7d18ba2e404aa4b64ef185a86fb5d7' account='Playback101' name='ReversalLong' orderState=Filled instrument='NQ 06-25' orderAction=Buy orderType='Stop Limit' limitPrice=20280.5 stopPrice=20280.25 quantity=1 tif=Gtc oco='' filled=1 averageFillPrice=20280.25 onBehalfOf='' id=18978 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'
                [DEBUG] Reversal to LONG; lockedPrevTradeExtremeShort = 20247.00
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===
                [DEBUG] Safety Check LONG: reversalPrice = 20246.75, currentBid = 20262.50
                [DEBUG] Long Tick: Submitting reversal stop-limit order with stop = 20246.75 and limit = 20246.50
                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='20fece2474f140f49a2eab50990231c5' account='Playback101' name='Close position' orderState=Submitted instrument='NQ 06-25' orderAction=Sell orderType='Stop Limit' limitPrice=20246.75 stopPrice=20247 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=18979 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'
                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='20fece2474f140f49a2eab50990231c5' account='Playback101' name='Close position' orderState=Accepted instrument='NQ 06-25' orderAction=Sell orderType='Stop Limit' limitPrice=20246.75 stopPrice=20247 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=18979 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'
                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='e5cd2fecdf3f4cf3b2b8e858853e6c6f' account='Playback101' name='ReversalShort' orderState=Submitted instrument='NQ 06-25' orderAction=SellShort orderType='Stop Limit' limitPrice=20246.75 stopPrice=20247 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=18980 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'
                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='e5cd2fecdf3f4cf3b2b8e858853e6c6f' account='Playback101' name='ReversalShort' orderState=Accepted instrument='NQ 06-25' orderAction=SellShort orderType='Stop Limit' limitPrice=20246.75 stopPrice=20247 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=18980 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'
                === Bar 5085, Time = 3/24/2025 9:46:00 AM ===


                As far as I can tell, the first stop limit was accepted and filled and the last stop limit was accepted.

                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='1d7d18ba2e404aa4b64ef185a86fb5d7' account='Playback101' name='ReversalLong' orderState=Filled instrument='NQ 06-25' orderAction=Buy orderType='Stop Limit' limitPrice=20280.5 stopPrice=20280.25 quantity=1 tif=Gtc oco='' filled=1 averageFillPrice=20280.25 onBehalfOf='' id=18978 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'

                3/24/2025 9:45:00 AM | GetCurrentAsk(): 20267.75, GetCurrentBid(): 20262.5 | orderId='e5cd2fecdf3f4cf3b2b8e858853e6c6f' account='Playback101' name='ReversalShort' orderState=Accepted instrument='NQ 06-25' orderAction=SellShort orderType='Stop Limit' limitPrice=20246.75 stopPrice=20247 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=18980 time='2025-03-24 09:45:00' gtd='2099-12-01' statementDate='2025-03-24'​
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Yesterday, 05:17 AM
                0 responses
                59 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