Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterLongLimit and EnterShortLimit OCO entry

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

    EnterLongLimit and EnterShortLimit OCO entry

    Hi all

    I would like to code a strategy that places two limit entry orders if it is flat, e.g. the current price is 1000 and the strategy is flat then it should place a enter long limit order at 980 and a enter short limit order at 1020. If one of the enter orders is filled the other order should be cancelled.

    How can this be achieved?

    Thank you for an answer in advance.

    Best regards

    #2
    Hello amusche,
    Thanks for writing in and I am happy to assist you.

    Please use the Unmanaged approach to submit both buy and sell order. To cancel the other limit order if one is filled, then please include an OCO (one cancels other) string to the orders.

    Code:
    SubmitOrder(0, OrderAction.Buy, OrderType.Limit, 1, 980, 0, "Entry", "BuyLimit");
    SubmitOrder(0, OrderAction.Sell, OrderType.Limit, 1, 1020, 0, "Entry", "SellLimit");



    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    61 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    148 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    98 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X