Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access working orders

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

    Access working orders

    Is there a way to access all working orders without assigning them first to some local class variable?

    #2
    Hi boaza, unfortunatelty this would not be possible - the strategy instance would only know about it's own individual orders associated, you can check their states if you work with the IOrder objects then.

    Comment


      #3
      OK Thanks.
      How can I access orders placed using the SetStopLoss() and SetProfitTarget()?

      Comment


        #4
        You would need to capture their IOrder 'returns' first basially, like shown in this sample :

        Comment


          #5
          Thanks Bertrand.
          Regarding the aforesaid sample code: the manual warns against using OnOrderUpdate() to track fills. I do not intend to track fills, but to capture each time the profit target and stop loss prices are updated via the SetStopLoss() and SetProfitTarget() methods.

          Some questions:
          • I may use this info to make decisions in my strategy. Is it OK to use this method, or do you recommend calculating the price when I call SetStopLoss()/SetProfitTarget() manually? (i.e. infer the price from the ticks and the entry price)
          • When is this method called? Just before the order is actually sent to the broker? Just after?


          Thanks,
          Boaz

          Comment


            #6
            Hi Boaz,

            Yes, OnOrderUpdate() can be used to expose details about stop loss and profit target prices directly. For the most precision on the actual values, you can work directly there. There isn't one best way to do things, so if your self calculated values are accurate and work well in your strategy, can use those as well.

            The OnOrderUpdate() method is called everytime an order managed by a strategy changes state. An order will change state when a change in order quantity, price or state (working to filled) occurs.


            It will go through some order state changes before the order arrives to broker. Can see this page for the listing of these.
            Last edited by NinjaTrader_RyanM1; 09-13-2011, 10:06 AM.
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            88 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            48 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            30 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            34 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            68 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X