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 NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    48 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X