Hello, I have obtained this error in a strategy: "Buy order stop price must be above last trade price ExchangeRejectCode = 2061 affected. Order: BuyToCover: 1 [email protected]" It has occurred because prices have moved very quickly. How can I avoid this situation? How can I prevent the strategy from being deactivated, even if an error like this occurs? Thanks in advance and regards.
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
ExchangeRejectCode
Collapse
X
-
ExchangeRejectCode
Hello, I have obtained this error in a strategy: "Buy order stop price must be above last trade price ExchangeRejectCode = 2061 affected. Order: BuyToCover: 1 [email protected]" It has occurred because prices have moved very quickly. How can I avoid this situation? How can I prevent the strategy from being deactivated, even if an error like this occurs? Thanks in advance and regards.Tags: None
-
Hello soyjesus,
Thanks for your post.
Situations like this can occur when the stop price is being submitted to close to the market when there is higher volatility. The stop price can be moved further away from the current market price, or the strategy can be modified so it does not disable on rejections.
To prevent the strategy from being deactivated, you can set the strategy's RealtimeErrorHandling property to IgnoreAllErrors or StopCancelCloseIgnoreRejects. With this property set, you can then trap order rejections in OnOrderUpdate if you would like to have the strategy attempt a different action.
RealtimeErrorHandling - https://ninjatrader.com/support/help...orhandling.htm
OnOrderUpdate() - https://ninjatrader.com/support/help...rderupdate.htm
Please let me know if I can be of further assistance.JimNinjaTrader Customer Service
- Likes 1
-
Hello soyjesus,
Thanks for your message.
Have you added the advised code for RealtimeErrorHandling so the strategy does not disable upon rejections?
What is the error you are receiving which results in the strategy disabling? Please include a screenshot or copy the error from the Log tab of the Control Center by selecting it and pressing Ctrl + C.
I look forward to assisting.JimNinjaTrader Customer Service
- Likes 1
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by pmachiraju, 11-01-2023, 04:46 AM
|
8 responses
148 views
0 likes
|
Last Post
by rehmans
Today, 06:44 PM
|
||
Started by mattbsea, Today, 05:44 PM
|
0 responses
5 views
0 likes
|
Last Post
by mattbsea
Today, 05:44 PM
|
||
Started by RideMe, 04-07-2024, 04:54 PM
|
6 responses
33 views
0 likes
|
Last Post
by RideMe
Today, 05:31 PM
|
||
Started by tkaboris, Today, 05:13 PM
|
0 responses
5 views
0 likes
|
Last Post
by tkaboris
Today, 05:13 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
16 responses
3,283 views
0 likes
|
Last Post
by Leafcutter
Today, 04:14 PM
|
Comment