Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop entry order rejected, how to solve this common problem?

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

    Stop entry order rejected, how to solve this common problem?

    Hi,

    I am developing a strategy with Strategy Builder, which does the following:
    - calculate on close
    - if a bunch of rules are met
    - then enter with a stop market order 1 tick above the high of the current bar

    This leads sometimes (actually quite often) to the case that the submitted stop order is rejected with the following error:
    "An order has been ignored since the stop price ‘15767.75’ near the bar stamped ‘11/13/2023 12:14:59’ is invalid based on the price range of the bar. This is an invalid order and subsequent orders may also be ignored."

    As I understand it, when the stop order is submitted, the ask price is already above the stop order, which must not be the case. This usually happens, when the close price is very near or at the high of the bar.

    This seems to be a very common problem. How is it typically solved or circumvented?

    I have tried the following logic, but am unsure, if that is correct:
    Added another condition, that checks, if the ask price is above or below the high of the entry bar. If it is already above, enter with a market order. If it is below submit the stop order.

    Thanks for some help, how this problem can be solved best, ideally using Strategy Builder, since I am not writing NS code myself. Thanks.

    Best regards
    Philipp

    #2
    Hello Philipp,

    Thanks for your post.

    "An order has been ignored since the stop price ‘15767.75’ near the bar stamped ‘11/13/2023 12:14:59’ is invalid based on the price range of the bar."

    This error message means that the stop price of the stop market order was not valid based on the price range of the bar the order was submitted to.

    Buy stop orders must be placed above the current ask price. Sell stop orders must be placed below the current bid price.

    Debugging prints should be added to the script that prints out the price you are submitting the order to and the GetCurrentBid() (Price folder > Bid) and GetCurrentAsk() (Price folder > Ask) to understand exactly how the orders are evaluating based on the price of the bar.

    Once you understand exactly how the orders are evaluating based on the price of the bar, you could modify your strategy to submit the order to a valid price.

    Below is a link to a forum post that demonstrates using prints to understand behavior.
    https://ninjatrader.com/support/foru...121#post791121

    You could find a very good guide on troubleshooting missed orders here, please read through this post and see if any of this applies to your situation:
    I am coding a strategy and am receiving numerous instances of the following error message: A Buy order placed at '[time]' has been ignored since the stop price is less than or equal to the close price of the current bar. I have searched the NinjaTrader forums and have read many posts related to this error message, but none
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Originally posted by philmg View Post
      Hi,

      I am developing a strategy with Strategy Builder, which does the following:
      - calculate on close
      - if a bunch of rules are met
      - then enter with a stop market order 1 tick above the high of the current bar

      This leads sometimes (actually quite often) to the case that the submitted stop order is rejected with the following error:
      "An order has been ignored since the stop price ‘15767.75’ near the bar stamped ‘11/13/2023 12:14:59’ is invalid based on the price range of the bar. This is an invalid order and subsequent orders may also be ignored."

      As I understand it, when the stop order is submitted, the ask price is already above the stop order, which must not be the case. This usually happens, when the close price is very near or at the high of the bar.

      This seems to be a very common problem. How is it typically solved or circumvented?

      I have tried the following logic, but am unsure, if that is correct:
      Added another condition, that checks, if the ask price is above or below the high of the entry bar. If it is already above, enter with a market order. If it is below submit the stop order.

      Thanks for some help, how this problem can be solved best, ideally using Strategy Builder, since I am not writing NS code myself. Thanks.

      Best regards
      Philipp
      I am encountering a similar issue-- did you manage to solve it?
      BB

      Comment


        #4
        Hello BB,

        I can provide an example created with the Strategy Builder that demonstrates setting a sell stop price, checking that it is less than the bid, and submitting the stop.
        ATRTrailingStopBuilderExample_NT8.zip

        This is similar to the example found linked below, but checks that the price is a valid price when using a stop exit.


        Last, below is a link to a support article on avoiding stop order rejections.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thank you !
          I managed to reduce the 'frequency' of such errors by using something like:

          ExitLongStopMarket(qty, Math.Min(StopB, GetCurrentBid()), @"LongStop", @"LongEntry");

          But this did not eliminate all rejection errors. Then I added

          RealtimeErrorHandling = RealtimeErrorHandling.StopCancelCloseIgnoreRejects ;

          But I surely will study what you suggested.

          Many thanks
          BB

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          110 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          59 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          37 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          41 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          78 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X