Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

"CancelOrder()" and "null"

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

    "CancelOrder()" and "null"

    Hello. Why in NT sample about live until canceled orders is used:

    in OnBarUpdate():
    Code:
    CancelOrder(entryOrder); 
    entryOrder = null;
    in OnExecution(IExecution execution) ONLY:
    Code:
    entryOrder = null;
    I read about CancelOrder() in Help. Please explain in your own words.

    #2
    Hello alexstox,

    Thank you for your post.

    The 'entryOrder' in this snippet is an IOrder object which would need to be set to null to allow it to be set once again when a new order is placed for the IOrder object name. The CancelOrder() called the IOrder name to cancel it and then it was set to null.

    For information on IOrder objects please visit the following link: http://www.ninjatrader.com/support/h...nt7/iorder.htm

    Please let me know if I may be of further assistance.

    Comment


      #3
      What the difference between cancel order and set it to null?
      We cancel order when don't want to trigger it?
      And we null order if order was in action?

      Am I right?

      What if I just set null without Cancel()? It will keep earlier order in the market AND give opportunity to put new order?
      Last edited by alexstox; 10-15-2013, 03:09 AM.

      Comment


        #4
        Hello alexstox,

        Thank you for your response.

        IOrder objects are a read only interface that exposes information regarding an order. Referencing the IOrder object allows you to access attributes of the IOrder object otherwise unattainable.

        Setting it to null when the associated order is cancelled is necessary to ensure it can be set again to a new order.

        Please let me know if I may be of further assistance.

        Comment


          #5
          So, if it just set to null, existing order will live further?

          Comment


            #6
            Hello alexstox,

            Thank you for your response.

            That is correct, the order would live on but the IOrder object would be null.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            164 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Started by CaptainJack, 04-24-2026, 11:07 PM
            0 responses
            319 views
            0 likes
            Last Post CaptainJack  
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            246 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            350 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            179 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Working...
            X