Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop Orders being cancelled at close of the bar

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

    #16
    Hello WalterSkinner,

    I only mentioned an error in response to your mention there was an error in post #10.

    The Print() would be the time of the bar and all values used in the conditions that submit the order and would let you know when the conditions are evaluating as true or false.
    TraceOrders would let you know when NinjaTrader is seeing the order submission and will let you know if the order is submitted, ignored, rejected, or automatically cancelled.

    These you would add. They would not be related to an error message that would appear on the Log tab of the Control Center.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #17
      Also, I am more than happy to make the change you suggested and switch over to using isLiveUntilCancelled.

      In doing this am I able to just include this:

      Code:
      ExitLongStopMarket(0, true, Position.Quantity, longTrailPrice, "Stop loss", "Long entry");
      Wherever I currently use ExitLongStopMarket?

      While looking at the documentation it mentions using CancelOrder. Is this really necessary? I swapped out the code for what I put in here and replay looks good without using CancelOrder. Will this get me into trouble?

      Thanks again for your help and patience.

      Comment


        #18
        Hello WalterSkinner,

        CancelOrder() is used to cancel an order if you don't want the order to be working any more.

        If you do not want to cancel the order at some point, you do not have to cancel the order.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #19
          Originally posted by NinjaTrader_ChelseaB View Post
          If you do not want to cancel the order at some point, you do not have to cancel the order.
          Ok great. Because my strategy exclusively uses stops to exit I should be fine then.

          If that was not the case, like if I exited using a target (sell limit for a long), in this case since I don't want the stop to exist anymore I would need to use CancelOrder()?

          Comment


            #20
            Hello WalterSkinner,

            This is demonstrated in the ProfitChaseStopTrailExitOrdersExample_NT8 linked in post# 7.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            81 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            42 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            64 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            66 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            55 views
            0 likes
            Last Post CarlTrading  
            Working...
            X