This just occurred.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Stop order can't be placed above the bid
Collapse
X
-
Stop order can't be placed above the bid
In set 6 I set the StopPrice -1 tick behind the bid. Should I make it -2 ticks or is there more I can do?
This just occurred.Tags: None
-
Hello trdninstyle,
Thanks for your post.
This error message means that the strategy attempted to place an order on the wrong side of the market. Buy stop orders must be placed above the current ask price. Sell stop orders must be placed below the current bid price.
If this is due to market volatility then there isn't really a way to 100% avoid this occurring, as in volatile markets the market could move so far and fast that this would occur.
You could consider placing your stop loss further from the current price to correct this error.
I would recommend you add prints to the strategy to determine why the stop order is being rejected. Prints should be added to the script that print out the value you are submitting your stop loss order to and prints out the current market price (Close[0]). This will allow you to see where the order is trying to be placed in comparison with the current market price.
Below is a link to a forum post that demonstrates using prints to understand behavior.
https://ninjatrader.com/support/foru...121#post791121
Something else you could consider is changing the strategy to use StopCancelCloseIgnoreErrors for its error handling. You could then capture the rejection in OnOrderUpdate, and then either try to resubmit the stop at a different price or submit an exit order to close the position. Note that this would require unlocking the strategy from the Strategy Builder and manually programming your logic.
You can find more information about real-time error handling for strategies here, along with an example of capturing the rejection:
https://ninjatrader.com/support/help...orhandling.htm
Let us know if we may assist further.Brandon H.NinjaTrader Customer Service
-
Hello BrandonH,
'Changing the strategy to use StopCancelCloseIgnoreErrors for its error handling. You could then capture the rejection in OnOrderUpdate, and then either try to resubmit the stop at a different price or submit an exit order to close the position.'
This sounds very interesting, plus what u said about the market when it's volatile that it just happens. Then I would just reset it. The other day it went the entire day without that happening so it could be that it was too volatile. But what if I set the bid at -2 tick size instead of -1 tick size. Could that have any bearing?
Thanks for your tip. Bill
Comment
-
Hello Bill,
Thanks for your note.
Increasing the stop loss by one extra tick would place the stop loss 1 more tick away the price that it is currently being submitted to.
Ultimately, you would need to test your strategy to determine if that one extra tick will keep the order rejection error from occurring. If the order rejection error continues to occur when testing, you may need to place your stop order further from the current price.
Further, prints should be added to the script that prints out the value you are submitting your stop loss order to and prints out the current market price (Close[0]). This will allow you to see where the order is trying to be placed in comparison with the current market price. Then you could modify your stop loss accordingly.
Below is a link to a forum post that demonstrates using prints to understand behavior.
https://ninjatrader.com/support/foru...121#post791121
Let me know if I may assist further.Brandon H.NinjaTrader Customer Service
Comment
-
I mean this thing, that ensures for the most part my stop stays 1 tick below the bid. Not the actual stop loss. If I set a further stop for all the time it will get hit on those reversals.
The opposite direction entry will cancel out my stop for the upside and vice versa.
So, what I meant was, for the -1 tick behind the bid, could I make it -2 or a higher #?
StopPrice = (GetCurrentBid(default input) + (-1 *TickSize));
BTY have a good holiday tomorrow. If it's late get back to me on Friday or Monday.Last edited by trdninstyle; 11-23-2022, 03:21 PM.
Comment
-
Hello trdninstyle,
Thanks for your note.
Yes, that is correct. You could set the StopPrice to use the Bid price minus 2 ticks or more to meet your goal.
Note that in volatile markets the market could move so far and fast that this error could still occur so you would need to test your strategy to ensure it behaves as you want it to.
I hope you have a good holiday too. Please let me know if you have further questions.
Brandon H.NinjaTrader Customer Service
- Likes 1
Comment
-
Okay that what I'll do, it's good to know that I can do that. I don't want to try something without knowing for sure if thats what it's meant to do.
You too buddy. Have a good one. Thanks.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ZeroKuhl, Today, 04:31 PM
|
0 responses
13 views
0 likes
|
Last Post
by ZeroKuhl
Today, 04:31 PM
|
||
Started by Vulgoth_t_Destroyer, 05-09-2022, 04:45 PM
|
54 responses
5,337 views
0 likes
|
Last Post
by Gaterz
Today, 04:29 PM
|
||
Started by ETFVoyageur, 05-07-2024, 07:05 PM
|
11 responses
76 views
0 likes
|
Last Post
by -=Edge=-
Today, 04:27 PM
|
||
Started by _Zero_, 04-10-2020, 03:21 PM
|
145 responses
7,900 views
6 likes
|
Last Post
by johng2
Today, 04:19 PM
|
||
Started by TheTradingMantis, 01-19-2023, 02:05 AM
|
43 responses
923 views
0 likes
|
Last Post
by jmagaia
Today, 04:13 PM
|
Comment