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!
See more
See less

Partner 728x90

Collapse

Order can't be placed

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

    Order can't be placed

    Hello,

    With my strategy I frequently get these types of messages: "Sell stop or sell stop limit orders can't be placed above the market" (and the same to the long side).

    I have included GetCurrentAsk() and GetCurrentBid() but the errors continue to appear. Is there another way to avoid these issues?
    Click image for larger version

Name:	dataurl133249.png
Views:	75
Size:	416 Bytes
ID:	1217418

    #2
    Hello soyjesus,

    Thanks for your post.

    This error message means that the strategy attempted to place an order to the wrong side of the market. 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.

    Something you could consider is using GetCurrentBid() and GetCurrentAsk() to offset orders so that they are more likely to land on the correct side of the market, as you have noted.

    See these help guide pages for more information.
    GetCurrentBid(): https://ninjatrader.com/support/help...currentbid.htm
    GetCurrentAsk(): https://ninjatrader.com/support/help...currentask.htm

    You could also consider using RealtimeErrorHandling.IgnoreAllErrors to trap order errors in OnOrderUpdate by checking error == ErrorCode.UnableToChangeOrder.

    Please note that setting this property value to IgnoreAllErrors can have serious adverse affects on a running strategy unless you have programmed your own order rejection handling in the OnOrderUpdate() method. To do this you could trap the rejected order by checking if the OrderState is Rejected within OnOrderUpdate() followed by defining your own order rejection handling behavior for the rejected order.

    Please see the example in the help guide link below that demonstrates using RealtimeErrorHandling and trapping a rejected order in OnOrderUpdate().

    RealtimeErrorHandling — https://ninjatrader.com/es/support/h...orhandling.htm

    Let us know if we may assist further.​
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by zstheorist, Today, 07:52 PM
    0 responses
    3 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    149 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    5 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Started by tkaboris, Today, 05:13 PM
    0 responses
    5 views
    0 likes
    Last Post tkaboris  
    Working...
    X