Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Scaling in then all out

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

    #16
    Ken,

    What exactly do you mean by catch all? What are you trying to accomplish with the quantity
    MatthewNinjaTrader Product Management

    Comment


      #17
      Mathew

      I need to exit All Open Long Positions at the Limit Price. That was the purpose of the emtpy ("") tag that Bertrand mentioned in post#10. These are unique entries. So is there a way to exit ALL instead of specifying an "int" in the quantity property? Scaling in then ALL out.
      Thanks

      Comment


        #18
        Hello kenb2004,
        Instead of cancelling the first target you can simply change it and submit a new 2nd target.

        Code:
        if (buy2entry != null && buy2entry == order)
        { 
            if (order.OrderState == OrderState.Filled) 
            {
               //update the existing limit order
                 ExitLongLimit(ExitLongLimit(0, true, 1, Position.AvgPrice + 4 * TickSize, "Buy_1Profit", "Buy_1Entry");
                 //submit a new order
        	 ExitLongLimit(ExitLongLimit(0, true, 1, Position.AvgPrice + 4 * TickSize, "Buy_2Profit", "Buy_2Entry");
        			
              
            }
        }
        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #19
          Why do you have 2 ExitLongLimit(ExitLongLimit.... in your code?

          Comment


            #20
            Hello kenb2004,
            To assist you further may I know what is your entry codes?

            I look forward to assisting you further.
            JoydeepNinjaTrader Customer Service

            Comment


              #21
              This is my entry code:
              if (condtion)
              buy1entry = EnterLongLimit(0, true, 1, Buy_1EntryPrice, "Buy_1");

              Comment


                #22
                Hello kenb2004,
                In post 13 you have referred to the following code:
                Code:
                protected override void OnOrderUpdate(IOrder order)
                {
                if (buy2entry != null && buy2entry == order)
                Can you tell me what is the buy2entry IOrder do?

                Can you please send a toy NinjaScript code* describing the exact scenario you are facing to support[AT]ninjatrader[DOT]com

                Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email.

                I look forward to assisting you further.

                *The "toy" just means something that is a stripped down version that isn't necessarily the whole logic. It makes things easier to rout out.
                JoydeepNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by tkaboris, Today, 05:13 PM
                0 responses
                2 views
                0 likes
                Last Post tkaboris  
                Started by GussJ, 03-04-2020, 03:11 PM
                16 responses
                3,281 views
                0 likes
                Last Post Leafcutter  
                Started by WHICKED, Today, 12:45 PM
                2 responses
                19 views
                0 likes
                Last Post WHICKED
                by WHICKED
                 
                Started by Tim-c, Today, 02:10 PM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by Taddypole, Today, 02:47 PM
                0 responses
                5 views
                0 likes
                Last Post Taddypole  
                Working...
                X