Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Canceling an ATM Order

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

    Canceling an ATM Order

    Hello

    I'm using an ATM strategy that sends a buy/sell order at the end of a closed bar to enter with a Stop Limit order if the next bar makes a tick higher than the high/lower than the low of the previous bar.
    Now, if the bar DOES NOT make that higher or lower tick, I'd like to cancel the order at the end of the bar. I obviously can't use the BarsSinceEntry command since the order state is "accepted" but not "filled" if the entry condition isn't met.

    Thanks for pointing me in the right direction.

    Regards

    #2
    laocoon, are you referring to a NinjaScript strategy or ATM template triggered from a NinjaScript strategy to manage your exits?

    You will need to work with either CancelOrder() or AtmStrategyCancelEntryOrder() for this task -





    Note also that if you're using a StopLimit entry from a NinjaScript strategy that this would expire if not filled with in the bar it was placed on, default NT behavior -

    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hello Bertrand

      Thanks for your reply. I'm familiar with the different order placement/management commands, but what I'm not familiar with is how to count the number of candles since the order was placed (BarsSinceEntry obviously doesn't work since I only want to cancel an order if it hasn't been filled in the previous candle).

      Thanks

      Comment


        #4
        laocoon, please correct me if I'm wrong, but you only want this StopLimit entry order to be placed for the next bar following the entry condition? Then it would expire automatically if not filled (unless you set it to liveUntilCancelled) -

        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hi Bertrand,

          Thanks for your reply, but I'm looking to do this with an ATM Strategy.create command, where LiveUntilCancelled does not exist.

          Sorry for the confusion.

          Thanks

          Comment


            #6
            laocoon, thanks for clarifying - then you would need for example save the time the order was placed and call the AtmStrategyCancelEntryOrder() once you're close to completing the current bar...a custom timer event would do as well for this.

            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by JonesJoker, 04-22-2024, 12:23 PM
            6 responses
            32 views
            0 likes
            Last Post JonesJoker  
            Started by GussJ, 03-04-2020, 03:11 PM
            12 responses
            3,239 views
            0 likes
            Last Post Leafcutter  
            Started by AveryFlynn, Today, 04:57 AM
            0 responses
            5 views
            0 likes
            Last Post AveryFlynn  
            Started by RubenCazorla, 08-30-2022, 06:36 AM
            3 responses
            79 views
            0 likes
            Last Post PaulMohn  
            Started by f.saeidi, Yesterday, 12:14 PM
            9 responses
            25 views
            0 likes
            Last Post f.saeidi  
            Working...
            X