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

RE: Using OnOrderUpdate() and OnExecution() methods to submit protective orders

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

    RE: Using OnOrderUpdate() and OnExecution() methods to submit protective orders

    Hi,

    I am referring to Stop orders to exit positions found in this thread: https://ninjatrader.com/support/foru...ead.php?t=7499

    Are exit stop orders disclosed to the exchange ? I mean are they shown to the public / my broker ? Or are they hidden?

    Tnx

    #2
    Hello YakusaTrader,
    Thanks for your post.

    The exit orders on that page will mostly be seen at the exchange with the exception of the MIT order type. Please see the following link for more information on MIT orders.

    NinjaTrader is a leading futures broker & trading platform provider with deep discount commissions as low as $.09 per Micro contract. Start your FREE demo powered by live data.


    We also support simulated stop orders. These orders remain in NinjaTrader until certain conditions are met - only then the orders will be submitted to the broker/exchange. Please see the link below for more information regarding simulated stop orders.

    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Tnx for your prompt response. I used simulated stop orders in the past and they don't get triggered all the time.
      Protective orders are working better for me so far.
      I just want to make sure, if I use protective orders https://ninjatrader.com/support/foru...ead.php?t=7499
      along with MIT (attached picture). Would these protective orders still be seen at the exchange?
      Attached Files

      Comment


        #4
        If you are referring to ExitShortMIT() or ExitLongMIT() than those orders would not be seen at the exchange. Your specific broker would have more information on how/if they manage MIT orders.

        NinjaTrader is a leading futures broker & trading platform provider with deep discount commissions as low as $.09 per Micro contract. Start your FREE demo powered by live data.
        Josh G.NinjaTrader Customer Service

        Comment


          #5
          Do you have any information on NinjaTrader brokerage? If not, who should I contact ?

          Comment


            #6
            For NinjaTrader Brokerage MIT orders would be active on the Continuum servers but not at the exchange.



            For more information on NinjaTrader Brokerage you can reach out to BrokerageSupport(AT)NinjaTrader(DOT)com
            Josh G.NinjaTrader Customer Service

            Comment


              #7
              Tnx.

              I tried ExitLongMIT() in the protective orders sample and it didn't work.



              I replaced ExitLongStopMarket by ExitLongMIT. I left Stop price the same. It's a variable from order update.

              Does ExitLongMIT. work on OnExecutionUpdate?

              Comment


                #8
                You can submit any of those order types from OnExecutionUpdate().

                MIT orders are similar to a stop order except the buy and sell actions are reversed. For example, a buy MIT order is submitted below market where a buy Stop would be submitted above market. Likely your order was rejected.

                You can confirm this by using TraceOrders. Please see the following links for more information on TraceOrders.

                Strategy Property- TraceOrders
                Tips - How to use TraceOrders
                Josh G.NinjaTrader Customer Service

                Comment


                  #9
                  I don't think my order was rejected. I was able to trace the order. It closed right away after it was opened.
                  From tracing the orders, MIT order Stop price seems to be correct from my script.

                  7/31/2018 5:23:00 PM Strategy 'Test/-1': Entered internal SubmitOrderManaged() method at 7/31/2018 5:23:00 PM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='MyEntry' FromEntrySignal=''
                  7/31/2018 5:23:00 PM Strategy 'Test/-1': Entered internal SubmitOrderManaged() method at 7/31/2018 5:23:00 PM: BarsInProgress=0 Action=Sell OrderType=MIT Quantity=1 LimitPrice=0 StopPrice=7286.50 SignalName='MyStop' FromEntrySignal='MyEntry'
                  7/31/2018 5:23:00 PM Strategy 'Test/-1': Entered internal SubmitOrderManaged() method at 7/31/2018 5:23:00 PM: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=1 LimitPrice=7289.50 StopPrice=0 SignalName='MyTarget' FromEntrySignal='MyEntry'
                  7/31/2018 5:23:01 PM Strategy 'Test/-1: Cancelled pending exit order, since associated position is closed, orderId='NT-00002-3916' account='Backtest' name='MyTarget' orderState=Working instrument='NQ 09-18' orderAction=Sell orderType='Limit' limitPrice=7289.5 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2018-07-31 17:23:00' gtd='2099-12-01' statementDate='2018-09-17'

                  This is trade #1 in the attached picture.
                  I don't understand what makes the open Long trade close right away.
                  This behavior doesn't happen with ExitLongStopMarket.
                  Attached Files

                  Comment


                    #10
                    The price for ExitLongMIT() should be above the market and it appears as if you have it set as your stoploss below the market. Please see the following public link for more information on MIT orders.

                    Josh G.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by adeelshahzad, Today, 03:54 AM
                    5 responses
                    31 views
                    0 likes
                    Last Post NinjaTrader_BrandonH  
                    Started by stafe, 04-15-2024, 08:34 PM
                    7 responses
                    31 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by merzo, 06-25-2023, 02:19 AM
                    10 responses
                    823 views
                    1 like
                    Last Post NinjaTrader_ChristopherJ  
                    Started by frankthearm, Today, 09:08 AM
                    5 responses
                    18 views
                    0 likes
                    Last Post NinjaTrader_Clayton  
                    Started by jeronymite, 04-12-2024, 04:26 PM
                    3 responses
                    43 views
                    0 likes
                    Last Post jeronymite  
                    Working...
                    X