Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnOrderUpdate(IOrder order) doubt .??!!

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

    OnOrderUpdate(IOrder order) doubt .??!!

    if i use OnOrderUpdate(IOrder order) to reset the IOrder entryOrder to null
    program is not executing y so how to fix this .. pls help

    #2
    Deall, what snippet or call do you exactly use? Why don't you do the reset in OnExecution then as the fill is seen and as would be recommended in our reference samples on this topic?

    The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()

    Comment


      #3
      OMG ....... in my program everything fine only thing is i couldnt find the way correct way and how to reset the entryorder to null again ......... i tried the way in ur samples can pls tell em how to do exactly in the IExecution to reset entry order to null

      if i do like in the way in samples or in examples in help .. program not at all executing im breaking my head for a week with this issue

      Comment


        #4
        Deall, the correct and recommended way is exactly contained in the example. Since I would not know how you now implemented it, I would just simplify the script until it works as you would expect and only then begin adding more complex parts in. When dealing with this debugging process in strategies two items can be very helpful understanding the exact event sequence seen -

        1. TraceOrders - http://www.ninjatrader.com/support/f...ead.php?t=3627
        2. Print statements - http://www.ninjatrader.com/support/f...ead.php?t=3418

        This way you can exactly tell in which state you variables / IOrders are at any given point and see hopefully isolate the offending part.

        Comment


          #5
          see this is my iexecution part in this where n how to reset entryorder to null rather than putting some links can u spot on the issue directly

          protected override void OnExecution(IExecution execution)
          {

          if (entryOrder != null && execution.Order != null && exitOrder == null )
          {
          Print("Bought price = " + execution.Price);

          }


          if (exitOrder != null && execution.Order != null)
          {
          Print("Closed@PositionAvgprice = " + execution.Price);


          }

          }

          Comment


            #6
            Deall, these links are posted and given purposeful abundantly in the forums as we believe it helps educating our user-base further and providing more value than 'fixing scripts'. For the reset you will spot this line in the SampleOnOrderUpdate example that is what you're after -

            if (entryOrder != null && entryOrder == execution.Order)
            if (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled || (execution.Order.OrderState == OrderState.Cancelled && execution.Order.Filled > 0))
            if (execution.Order.OrderState != OrderState.PartFilled)
            entryOrder = null;

            Comment


              #7
              thnanks for ur sggestions n replys ....

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              582 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              338 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              554 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              552 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X