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

Can I use an IB Bracket Order via NinjaScript?

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

    Can I use an IB Bracket Order via NinjaScript?

    IB is my broker and they allow Bracket Orders. These will automatically associate each order with a Target and a Stop (like NinjaTrader's ATM Strategies).

    How can I create an actual (meaning: on IB servers) Bracket Order using Ninja scripting?

    If I must create my own Stops and Targets using EnterShort/Long-type methods, how can I have them associated (with OCO OneCancelsOther and/or OCA - OneCancelsAll)? It seems that simply tying them together with a SignalName wouldn't actually create an OCO on IB servers.

    Will ATMStrategyCreate() actually associate the orders as OCA on IB servers?

    Thanks,

    Brian1

    #2
    Brian1,

    Please see the reference sample here: http://www.ninjatrader-support2.com/...ead.php?t=7499

    What you want to do is check their order states. When one of them gets filled you go ahead and go CancelOrder() on the other one.

    AtmStrategyCreate() does create OCOs on the IB servers.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      What about sending a limit order to rest on IB servers with its contingent orders.
      I cant see anything in the ATMStrategyCreate that associates the parent with its contingents.

      Thks

      Comment


        #4
        When this order would execute the resulting brackets would be OCO'ed on the IB servers, if they were placed through an ATM.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hi,

          So the Parent limit order is sent to the IB server with its contingent Target/StopLoss?
          The Parent is resting/working on the IB server and doesn't need to communicate with NT thereafter?

          I want to be able to send an atomic group of orders say, at Close/Open and not need to concern myself with connectivity issues thereafter.Once the parent is activated, there is no need for any involvement by NT.

          The Interactive Brokers API enforces providing the contingent orders with the id of their parents. Is this the case with NT? I am not able to see in ATM how the bracket is created.

          Thanks.

          Comment


            #6
            No, the parent order would need to execute first, then NT would send the exit OCO'ed bracket working on the IB servers, atomic orders all on IB's servers are not supported unfortunately.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Hey guys,

              Given this thread is over 5 years old I have to ask the question. Are these 'atomic' type orders supported for IB yet?

              I'm coding the order management for my automated scalping strategies in NT8, being able to have a parent stop order to enter which when triggered submits OCO profit target and stop loss orders would be ideal for me, obviously theres a risk advantage here re connectivity and fast moving markets with orders close to the market.

              cheers,
              Chris

              Comment


                #8
                +1, professional order management is needed, FXCM also support entry+stop+target order type.

                Comment


                  #9
                  Hello cjdsellers and wolfram,

                  Such an order type is not natively supported in NinjaTrader. You can create similar advanced order techniques in NinjaScript.

                  Comment


                    #10
                    Thanks for the reply Patrick,

                    Ok, so these order types aren't supported with the current version of NT8.

                    But will they be supported in the future?

                    I believe that IB use 'attached' orders where you can create an OCO bracket which submits to market only once the parent order has been triggered. This is supported even by TWS mobile so surely there wouldn't be too much coding involved to implement an option for this order submission in NT8?

                    FXCM also have OCO and 'complex OCO' available with their Trading Station platform. I believe these orders exist on their server side once submitted, do you guys intend on supporting these OCO order submissions since Trading Station obviously support them? Rather than having NT8 'simulate' them with the software, which can be coded unmanaged by the user anyway.

                    thanks again, and keep up the great work!

                    cheers
                    Chris

                    Comment


                      #11
                      Hello cjdsellers,

                      Thank you for your response.

                      I will forward these suggestions to our development team.

                      Comment


                        #12
                        This suggestion is being tracked under id number SFT-1091.

                        Comment


                          #13
                          Transition Strategy orders to OCO

                          Hi - reviving this thread for a basic question:

                          I am running a strategy to trade equities, and essentially I am dynamically setting up my 'entry', 'quantities', and target/stop based on several predetermined criteria.

                          My goal is to enter the trade in a NinjaScript strategy, submit all my target/stop orders, and exit the strategy will all orders in place. Meanwhile, for the orders would be OCO in TWS because these trades are Swing based and could take several days to complete.

                          I have been able to successfully achieve all my goals, EXCEPT for the fact that I just discovered the orders are not OCO in TWS - i.e. once my strategy has exited, each order is standalone.

                          Other than rewriting my entire strategy to incorporate ATM strategies in Ninjascript - is there any other way that can be recommended to achieve OCO from an exited strategy?

                          Please advise.

                          Thanks,
                          Alex

                          Comment


                            #14
                            Hello Shadowfox,

                            Thank you for writing in.

                            So I can best understand your question, I will need more information.

                            You state that when your strategy has exited, each order is stand alone. Are you saying that your strategy will submit a closing order which is not the stop or profit target, and both those orders remain working without an OCO when that closing order is filled? Or is your stop left working after your profit target is filled?

                            If you could also provide your log and trace files with the exact date and time of the behavior that would be helpful.

                            Please send an email to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and attach the log and trace files for the day in subject which you can find in My Documents>NinjaTrader8>Log and My Documents>NinjaTrader8/Trace folders.

                            I look forward to your email.
                            Alan P.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by mjairg, 07-20-2023, 11:57 PM
                            3 responses
                            213 views
                            1 like
                            Last Post PaulMohn  
                            Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                            4 responses
                            544 views
                            0 likes
                            Last Post PaulMohn  
                            Started by GLFX005, Today, 03:23 AM
                            0 responses
                            3 views
                            0 likes
                            Last Post GLFX005
                            by GLFX005
                             
                            Started by XXtrader, Yesterday, 11:30 PM
                            2 responses
                            12 views
                            0 likes
                            Last Post XXtrader  
                            Started by Waxavi, Today, 02:10 AM
                            0 responses
                            7 views
                            0 likes
                            Last Post Waxavi
                            by Waxavi
                             
                            Working...
                            X