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

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.
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    238 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    382 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    1 view
    0 likes
    Last Post oviejo
    by oviejo
     
    Started by pechtri, 06-22-2023, 02:31 AM
    10 responses
    125 views
    0 likes
    Last Post Leeroy_Jenkins  
    Started by judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    59 views
    0 likes
    Last Post DynamicTest  
    Working...
    X