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