Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
order rejected. above market
Collapse
X
-
order rejected. above market
i got this message in my orders tab. i'm not sure what it means. i have an exit market order. should i have exit limit order that way its a set defined price. i had 28 ticks slippage in my favor on one trade for profit. but 100 ticks slippage for stop market order not in my favor.Tags: None
-
Hello SteveReiza,
Thank you for your post.
This message means that the strategy attempted to change an order to the wrong side of the market. Sell stop market orders must be placed below the current Bid price.
You can use GetCurrentBid() and GetCurrentAsk() to make sure that the price you are submitting or changing the order to is a valid price and on the correct side of the market.
Help Guide: NinjaScript > Language Reference > Common > Analytical > GetCurrentBid()
Help Guide: NinjaScript > Language Reference > Common > Analytical > GetCurrentAsk()
For example, for a sell stop market order:
This will ensure that your stopPrice is below the current Bid price, by checking is the stopPrice is above the current Bid and if so moving it below.Code:double stopPrice = Low[0]; if (stopPrice >= GetCurrentBid()) stopPrice = GetCurrentBid() - TickSize. EnterShortStopMarket(stopPrice);
Please note that if the error occurred due to market volatility, then there is no way to 100% avoid this occurring, as in volatile markets the market could move so far and fast that this would occur.
If you are using Set methods, like SetStopLoss(), with CalculationMode.Price please note that these cannot be unset so they will continue to have the previous entry’s price so when a new entry is submitted. This can also cause this error.
From the Help Guide on SetStopLoss():
”Should you call this method to dynamically change the stop loss price in the strategy OnBarUpdate() method, you should always reset the stop loss price / offset value when your strategy is flat otherwise, the last price/offset value set will be used to generate your stop loss order on your next open position.”
Help Guide: NinjaScript > Language Reference > Strategy > Order Methods > Managed Approach > SetStopLoss()
Set methods should always be set or reset before the entry is called with CalculationMode.Ticks before calling a new entry. They can then be adjusted to a specific price after the entry fills.
Please let me know if you have any other questions.
-
thanks for the reply. okay sweet good to know about the bid. i'm dialed in on what i need to do so that doesn't happen again. appreciate the guidance!
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
62 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
134 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
75 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
45 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
50 views
0 likes
|
Last Post
|

Comment