• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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?

    http://www.ninjatrader.com/support/f...ead.php?t=7499
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        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("[email protected] = " + 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;
            BertrandNinjaTrader Customer Service

            Comment


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

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Erhard, Today, 04:24 AM
              1 response
              17 views
              0 likes
              Last Post NinjaTrader_ChrisSch  
              Started by rontronimous, Yesterday, 05:55 PM
              2 responses
              18 views
              0 likes
              Last Post rontronimous  
              Started by brunoviveiros, Today, 04:26 AM
              0 responses
              3 views
              0 likes
              Last Post brunoviveiros  
              Started by StevenNelson, 11-19-2019, 05:39 AM
              3 responses
              21 views
              0 likes
              Last Post brucerobinson  
              Started by guidoisot, Today, 03:01 AM
              0 responses
              8 views
              0 likes
              Last Post guidoisot  
              Working...
              X