Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Having trouble creating StopMarket and StopLimit Orders.

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

    Having trouble creating StopMarket and StopLimit Orders.

    Having trouble with StopMarket and StopLimit Orders...

    Manually I can create them fine but programmically I get the below...

    Getting this error:
    Buy stop or buy stop limit orders can't be placed below the market. affected Order: Buy 1 StopLimit @ -2x3445.75.

    The current market was 3444.50 which this stop limit order was above not below like the error states. The code I tried is below here.

    stopOrder = myAccount.CreateOrder(chartTrader.Instrument, OrderAction.Buy, OrderType.StopLimit, OrderEntry.Manual, TimeInForce.Gtc, qty, StopLimitPrice, 0, ocoGuid.ToString(), "stopOrder", Core.Globals.MaxDate, null);

    myAccount.Submit(new[] { stopOrder });

    I tried the Stop Market Order example and it also throws this error. Link I looked at: https://ninjatrader.com/support/help...t8/?submit.htm

    Regular Market and Limit Orders work fine for me...

    entryOrder = myAccount.CreateOrder(chartTrader.Instrument, OrderAction.Buy, OrderType.Market, OrderEntry.Manual, TimeInForce.Gtc, qty, price, 0, ocoGuid.ToString(), "Entry", Core.Globals.MaxDate, null);

    myAccount.Submit(new[] { entryOrder });

    #2
    Hello jalley,

    Thanks for your post.

    Stop Market and Stop Limit orders must be placed on the right side of the market. If the stop price is placed to the other side of the market, the order will be rejected. The example snippet in the help guide has 1400 set for the stop price and this can result in a rejection if it the market is below this Sell Stop Market order's price.

    3 basic order types - https://ninjatrader.com/blog/3-basic...pes-explained/

    With manual trading, NinjaTrader will allow you to submit a Stop Limit order on the other side of the market, which would create a Simulated Stop Limit order, which has a yellow order marker. This means the order is simulated locally, and is not actually submitted to the brokers order routing servers. (Once the simulated stop order's stop price triggers, it will submit a limit order to the broker's order routing server at the order's limit price.)

    Simulated stops - https://ninjatrader.com/support/help...top_orders.htm

    From AddOn Framework code, we can share that the CustomOrder parameter would be used to create a simulated Stop Limit order, but we do not offer any documentation on usage and thus the CustomOrder parameter is unsupported.

    We are tracking interest behind documenting the CustomOrder parameter so it can be supported for use in AddOn Framework code and the ticket Id is SFT-3180. I have added a vote on your behalf.

    Feature Request Disclaimer.

    We receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing.

    When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number will be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.

    Release Notes - https://ninjatrader.com/support/help...ease_notes.htm


    We look forward to assisting.

    Comment


      #3
      Solution found for this problem as per

      https://ninjatrader.com/support/foru...00#post1212900
      Last edited by trader-ap; 08-23-2022, 01:11 AM. Reason: Solution found

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      637 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      366 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      107 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      569 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      572 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X