Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cancel Order on ATM Strategy

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

    #61
    Thanks Bertran, I would like to ask if what is the best thing that i would do if I have called an Atm Strategy template when my specified condition reached and then suddenly in the next 2 bars I need to cancel the order with limit because it crosses to my exit condition. I am confuse what I am going to do, I will cancel the Atm strategy order and then use exit method to close entirely the market position?. When using AtmStrategyCancelEntryOrder(OrderId) method does it imply that the market position is closed? Or do I need to add Exit Method?

    Comment


      #62
      No, cancelling the working entry order with the orderID would just mean that - it would not exit any open position for you - for this you would also need to Close the ATM programmatically.
      BertrandNinjaTrader Customer Service

      Comment


        #63
        Closing the ATM programmatically then I will use AtmStrategyClose("idValue"); after I cancelled the order? idValue parameter would be the atmstrategyId?

        Comment


          #64
          Thanks for your reply Bertrand. I am so confused with this problem will you please help me.

          I have a strategy that will call an ATM strategy and I based it from the SampleAtmStrategy in NT then I wonder if why does the example execute an orderId=string.empty when the limit is filled? If the orderID is now empty does it mean that the entire order is already done because the it is already filled on that bar? How about the profit targets, stop loss and trail stop of my atm strategy are now useless because the OrderId is now empty? Or they will continue to process the profit targets, stop loss, and trail stop even if the OrderId is empty? I am now very confuse please help.

          Comment


            #65
            Is this code correct in checking order status if it is filled two bars after the order?
            if (orderBarL >=2 && statusL[2]!="Filled")

            {
            CancelATMOrder();
            CloseATM();
            }

            Thanks.

            Comment


              #66
              Hello Luxurios,

              The reason the string is emptied is so that it can be used again for the next order placed. If it's filled, cancelled, rejected, then this will reset the string value.

              Stops and targets can still continue to function but are not managed by NinjaScript. Once your ATM entry order has been filled, you're essentially passing the management of your exits to the ATM strategy specified.

              For your Next Post:
              Yes, it depends on how you have defined OrderBarL but that concept should work.
              Ryan M.NinjaTrader Customer Service

              Comment


                #67

                Okay, thanks for that RyanM now I understand why. Thanks a lot.
                How abut this code RyanM:

                atmStrategyIdL = GetAtmStrategyUniqueId();
                orderIdL = GetAtmStrategyUniqueId();
                orderBarL=CurrentBar;
                AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Limit, Low[0], 0, TimeInForce.Day, orderIdL, ATMstrategyTemplate, atmStrategyIdL);

                if (CurrentBar >= orderBarL + 2 )
                {
                if (statusL[2]=="Working" || statusL[2]!="Filled")
                CancelATMOrder();
                }
                I will cancel the order if two bars lapse from the order bar and then the order has not been filled.
                Last edited by luxurious_04; 09-07-2010, 07:52 PM.

                Comment


                  #68
                  Once the order is cancelled, the orderId is now reset then does it mean that the atmstrategyId is also in reset mode? So that if there is another entry signal then the strategy could get that signal..
                  Last edited by luxurious_04; 09-07-2010, 08:07 PM.

                  Comment


                    #69
                    The orderId and atmStrategyId are not connected, you would need to reset them independently.
                    BertrandNinjaTrader Customer Service

                    Comment


                      #70
                      Thanks a lot Bertran, your a great man.

                      When my order gets filled and then in the next bar I will exit because it reaches my exit condition. I will close the ATM programmatically and then reset the atmstrategyId and wait for the next entry signal. Does my thoughts for this is correct?

                      Comment


                        #71
                        That sounds correct, please note that you won't need to close the ATM if it reaches one of the ATM generated exits -you would in this case then only need to reset the strategy id.
                        BertrandNinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by 00nevest, Today, 02:27 PM
                        0 responses
                        1 view
                        0 likes
                        Last Post 00nevest  
                        Started by Jonafare, 12-06-2012, 03:48 PM
                        5 responses
                        3,986 views
                        0 likes
                        Last Post rene69851  
                        Started by Fitspressorest, Today, 01:38 PM
                        0 responses
                        2 views
                        0 likes
                        Last Post Fitspressorest  
                        Started by Jonker, Today, 01:19 PM
                        0 responses
                        2 views
                        0 likes
                        Last Post Jonker
                        by Jonker
                         
                        Started by futtrader, Today, 01:16 PM
                        0 responses
                        9 views
                        0 likes
                        Last Post futtrader  
                        Working...
                        X