Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unmanaged order management: Handling stops

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

    Unmanaged order management: Handling stops

    Hi there,

    when using the unmanaged approached, what is the "proper" way to deal with stops?

    When a position is closed based on a previously set stop, will the Filled field of the respective IOrder instance drop to 0?

    Does this trigger an OnExecution event?

    Is there a direct way to access the broker / account position information? If not, how do I properly update my own position tracking after a connection loss?

    TIA!

    #2
    koschba,

    Any order when filled would trigger an on-execution event. As such you can check to see if your stop is triggered there.

    To get account info you can use : http://www.ninjatrader.com/support/h...countvalue.htm

    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Adam,

      thanks for your reply.

      To clarify, please assume the following order

      Code:
      myOrder = SubmitOrder(0, OrderAction.Buy, OrderType.Stop, 1, 0, 5, ...);
      gets filled at 10$.

      This triggers an OnExecution event,
      myOrder.Filled now is 1 and
      myOrder.OrderState == OrderState.Filled

      I assume, this is correct so far.

      Assume, the price drops to 4$.

      You wrote, filled orders would trigger OnExecution event. My order was already filled.

      Do I get an OnExecution event again if the stop is hit? If yes, does the OnExecution event argument contain a reference to myOrder, null or something else?

      Does the OrderState remain Filled?

      Thanks.

      Comment


        #4
        koschba,

        Since a stop order is a order that exists on the exchange it still gets filled.



        Using the sample in the help guide, you would see something printed like this :

        Execution='NT-00004' Instrument='ES 03-12' Account='Backtest' Name='Buy' Exchange=Default Price=1275.75 Quantity=1 Market position=Long Commission=4.5 Order='NT-00008' Time='1/3/2012 5:05:00 AM'

        Execution='NT-00005' Instrument='ES 03-12' Account='Backtest' Name='Stop loss' Exchange=Default Price=1274.5 Quantity=1 Market position=Short Commission=4.5 Order='NT-00009' Time='1/3/2012 5:10:00 AM'

        The unmanaged approach should still trigger executions but you would need to track the orders closer.

        This is when a buy resulted in getting stopped out.
        Adam P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X