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:	18
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 AlexEro, Today, 12:29 AM
    0 responses
    3 views
    0 likes
    Last Post AlexEro
    by AlexEro
     
    Started by Vincere, 01-20-2019, 08:42 AM
    13 responses
    330 views
    0 likes
    Last Post AlexEro
    by AlexEro
     
    Started by bltdavid, 12-01-2022, 07:59 PM
    10 responses
    37 views
    0 likes
    Last Post jeronymite  
    Started by StealthM93, Yesterday, 11:09 PM
    0 responses
    1 view
    0 likes
    Last Post StealthM93  
    Started by digibob, 11-22-2020, 10:59 PM
    3 responses
    110 views
    0 likes
    Last Post FutureDragon  
    Working...
    X