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

attach stop order to Entry order.

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

    attach stop order to Entry order.

    Hello,

    I am working with Unmanaged method connecting to IB API.

    TWS allowed to attach (tied) to orders (I do not mean to OCO order) that one order will trig the second order.

    For example:

    I would like to attach stop order to Entry order. if the Entry order will executed then the stop order will fired immediately at the same quantity as enter order was filled.
    In fact I'm interested to submit these attached orders In one command without wait to enter order execution

    Sincerely, Kobi

    #2
    Hello Kobi, thanks for writing in.

    In NinjaTrader you can deploy ATM strategies within a NinjaScript strategy. See the "SampleATMStrategy" in the Strategies folder for a full example, we also have documentation here:



    There's also a way to tie protective orders to entries in a "manual" way using OnOrderUpdate/OnExecutionUpdate, see here for an example:



    Please let me know if you have any questions about this material.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello Chiris L,

      Thank you for your response!

      I using Unmanage order Method, I don't want to use ATM strategies.

      I know that I can use OnOrderUpdate/OnExecutionUpdate method and when order state filled or partial filled immediately send stop order.

      That not what I asked. I would like to manually tie the the stop order to enter order in one command. I would not want to wait for Enter order execution.

      This is very important , for the case of connection loss and other reasons.

      It can be a scenario that the strategy sent Enter order which pending\working on the broker , and in this time I loss a connection.
      In the time of connection loss the Enter order can be filled and I will not have a stop loss order for protection.

      It will be useful to send the two orders as attach orders. The TWS platform support it and IB API support it.

      Does NT also support it?

      Sincerely, Kobi

      Comment


        #4
        Hello Kobi, thanks for your reply.

        To submit an order that rests along with an entry order, you would submit the protective orders when the entry order has reached State.Accepted or State.Working, this would be done using the OnOrderUpdate event method. We have a related example here that demonstrates a bracket in the unmanaged approach, instead of submitting the orders in OnExecutionUpdate when the order fills, submit the protective orders in OnOrderUpdate when the entry order has reached State.Accepted or State.Working.

        https://ninjatrader.com/support/foru...elp#post770579

        We do have the SetStopLoss and SetProfitTarget method, which essentially ties in protective orders in one method call, but they can not be used while using the Managed Approach.

        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Waxavi, Today, 02:10 AM
        0 responses
        4 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        10 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        2 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by elirion, Today, 01:36 AM
        0 responses
        4 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by gentlebenthebear, Today, 01:30 AM
        0 responses
        4 views
        0 likes
        Last Post gentlebenthebear  
        Working...
        X