Announcement

Collapse
No announcement yet.

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:

    https://ninjatrader.com/support/help...gy_methods.htm

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

    https://ninjatrader.com/support/help...and_onexec.htm

    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 robforee2, Today, 01:05 PM
        0 responses
        4 views
        0 likes
        Last Post robforee2  
        Started by Kaalhus, Today, 12:47 PM
        2 responses
        24 views
        0 likes
        Last Post Kaalhus
        by Kaalhus
         
        Started by SpikeLGWG, Today, 12:35 PM
        0 responses
        10 views
        0 likes
        Last Post SpikeLGWG  
        Started by Johnny, Today, 11:55 AM
        3 responses
        20 views
        0 likes
        Last Post NinjaTrader_Spencer  
        Started by MGHORBEL, Today, 10:48 AM
        0 responses
        21 views
        0 likes
        Last Post MGHORBEL  
        Working...
        X