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

Cancel pending order after next bar closes

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

    Cancel pending order after next bar closes

    Hi,

    If NT launches a LMT order and it's pending, is it possible to cancel the order if it's not accepted within the next bar close?

    Thanks.

    #2
    Originally posted by siroki View Post
    Hi,

    If NT launches a LMT order and it's pending, is it possible to cancel the order if it's not accepted within the next bar close?

    Thanks.
    Where? Code or manually placed orders?

    Comment


      #3
      In code, but I think I've already read that EnterLongLimit and EnterShortLimit has the liveUntilCancelled which is default set to false. So this would mean a limit order is by default cancelled if not completed within the current bar.

      "....liveUntilCancelled
      The order will NOT expire at the end of a bar but instead remain live until the CancelOrder() method is called or its time in force has been reached......"

      Comment


        #4
        Originally posted by siroki View Post
        In code, but I think I've already read that EnterLongLimit and EnterShortLimit has the liveUntilCancelled which is default set to false. So this would mean a limit order is by default cancelled if not completed within the current bar.

        "....liveUntilCancelled
        The order will NOT expire at the end of a bar but instead remain live until the CancelOrder() method is called or its time in force has been reached......"
        You found the answer. That is the default behavior.

        Comment


          #5
          Hello Siroki,

          Thank you for your post and thank you to Koganam for helping.

          Correct, this is already the default behavior with NinjaScript to cancel the order if not accepted when the bar closes.

          I
          Cal H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by fx.practic, 10-15-2013, 12:53 AM
          5 responses
          5,406 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by Shai Samuel, 07-02-2022, 02:46 PM
          4 responses
          98 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by DJ888, Yesterday, 10:57 PM
          0 responses
          8 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by MacDad, 02-25-2024, 11:48 PM
          7 responses
          160 views
          0 likes
          Last Post loganjarosz123  
          Started by Belfortbucks, Yesterday, 09:29 PM
          0 responses
          9 views
          0 likes
          Last Post Belfortbucks  
          Working...
          X