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

"“Sell stop or sell stop limit orders can’t be placed above the market" error

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

    "“Sell stop or sell stop limit orders can’t be placed above the market" error


    Folks, I'd like to better understand the resolution for this error:

    “Sell stop or sell stop limit orders can’t be placed above the market. Strategy submitted an order that generated the following error - order rejected....”

    I've seen this issue discussed frequently on the forum. You provide quality responses, which I appreciate. For my code, testing in Playback, I was able to eliminate this error by changing the code from:

    EnterShort()

    to

    EnterShortStopMarket(GetCurrentBid())

    I'm happy to have this fixed, but it still leaves me wondering why this error happens in the first place? Since EnterShort places an order at the market price, then how can the price be submitted above the market price? Thanks,



    #2
    Hello timmbbo,

    Thanks for your post.

    Sell stop and sell stop limit orders must be placed below the current bid price. If they end up being submitted above the market, this error will occur.

    Note 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.

    I would recommend you add prints to the strategy to determine why the stop order error is occurring. One line above where the stop order is placed, print the GetCurrentBid() and print the price being submitted to the order method.

    Below is a link to a forum post that demonstrates using prints to understand behavior.
    https://ninjatrader.com/support/foru...121#post791121

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

    Or, you could place your stop order further from the current price.

    See the help guide documentation below for more information.

    GetCurrentBid(): https://ninjatrader.com/support/help...currentbid.htm​​
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Balage0922, Today, 07:38 AM
    0 responses
    5 views
    0 likes
    Last Post Balage0922  
    Started by JoMoon2024, Today, 06:56 AM
    0 responses
    6 views
    0 likes
    Last Post JoMoon2024  
    Started by Haiasi, 04-25-2024, 06:53 PM
    2 responses
    19 views
    0 likes
    Last Post Massinisa  
    Started by Creamers, Today, 05:32 AM
    0 responses
    6 views
    0 likes
    Last Post Creamers  
    Started by Segwin, 05-07-2018, 02:15 PM
    12 responses
    1,786 views
    0 likes
    Last Post Leafcutter  
    Working...
    X