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 rhyminkevin, Today, 04:58 PM
                4 responses
                52 views
                0 likes
                Last Post dp8282
                by dp8282
                 
                Started by iceman2018, Today, 05:07 PM
                0 responses
                5 views
                0 likes
                Last Post iceman2018  
                Started by lightsun47, Today, 03:51 PM
                0 responses
                7 views
                0 likes
                Last Post lightsun47  
                Started by 00nevest, Today, 02:27 PM
                1 response
                14 views
                0 likes
                Last Post 00nevest  
                Started by futtrader, 04-21-2024, 01:50 AM
                4 responses
                50 views
                0 likes
                Last Post futtrader  
                Working...
                X