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 NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            59 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            134 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            75 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            45 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            50 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X