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

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.
    JimNinjaTrader Customer Service

    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 LiamTwine, Today, 08:10 AM
      0 responses
      2 views
      0 likes
      Last Post LiamTwine  
      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  
      Working...
      X