Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OCO + Limit Order

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

    OCO + Limit Order

    Hi

    I want to trade stocks via IB and Ninjatrader 8 and want to automatically attach a stop and a limit order to the order to open a position.

    For example:

    Buy Limit @$100

    Then I want to automatically attach

    Sell Stop Market @$99
    Sell Limit @$103

    The attached orders should be visible before the Buy order is executed, such that I can move them around and adjust to my setup (the latest higher low in a chart for the stop for example). The attached orders should be OCO.

    Thank you for your help!

    Thanks, regards




    #2
    Hi treadstone144, thanks for your question and welcome to the NinjaTrader forum. We are happy to have you here.

    This can be done in two ways in a NinjaScript strategy. The first method is the "manual" method using OnExecutionUpdate and OnOrderUpdate to submit protective orders. With this method, you will not be able to move the stop and target manually:



    The other method would be to use an ATM template within the strategy. We have a sample in the platform called "SampleATMStrategy". We also have a help guide page on the subject here:



    The caveat with using ATM strategies is that they can not be backtested.

    Please let me know if I can assist any further.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    135 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X