Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 junkone, Today, 11:37 AM
            2 responses
            14 views
            0 likes
            Last Post junkone
            by junkone
             
            Started by frankthearm, Yesterday, 09:08 AM
            12 responses
            44 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by quantismo, 04-17-2024, 05:13 PM
            5 responses
            35 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by proptrade13, Today, 11:06 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by love2code2trade, 04-17-2024, 01:45 PM
            4 responses
            35 views
            0 likes
            Last Post love2code2trade  
            Working...
            X