Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Scaling in then all out

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

    Scaling in then all out

    When scaling in at different price levels and then exiting all positions at one price, is it necessary or best to use unique entry names or is not necessary at all? Can this senario be achieved with no entry names at all?
    Thanks

    #2
    Ken, if you're not working in the unmanaged mode, you would need to use unique names.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I'm using Advanced Managed Approach with Iorders. So if a Buy1 entry had a target of 4 ticks profit and then Buy2 enters 4 ticks lower, how would you put both target 4 ticks from the average price with unique entry names.
      Thanks

      Comment


        #4
        Do you want to exit at 4 ticks for the combined entry price?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Yes, the average (combined) of the 2 entry prices.

          Comment


            #6
            There would be 2 ways to approach this -

            a) Calculate the exit price needed from your individual executions received

            b) Update the target exit order after the second fill is in and your Position.AvgPrice would be updated to reflect the new average
            BertrandNinjaTrader Customer Service

            Comment


              #7
              In approach b) how could you adjust the exit target of Buy1 2 ticks lower and make the Buy2 target the same as the Buy1 target with the execution of Buy2 entry being filled?

              Comment


                #8
                You would check for the fill state of your second IOrder (so you know you're in the full position) and then you just recall the exit order method / set method with your newly calculated target values to provide the adjustment.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Bertrand
                  Is there a way to cancel the Buy1 target and combine the 2 targets to the Buy2 exit with a quantity of 2, 4 ticks from the Position.AvgPrice?
                  Or does it need to be handled individually: Buy1 target = Buy1 Entryprice + 2 and Buy2 target = Buy2 Entryprice + 6?
                  Thanks
                  Last edited by kenb2004; 06-25-2012, 09:46 AM.

                  Comment


                    #10
                    Ken, if you work with the Set methods this would not be possible, as you can't cancel them only move closer or further away. When you work with the Exit() methods you could cancel an individual exit order and submit a final exit order for example with a emtpy ("") tag so it would 'catch' all orders.
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Thanks, are there any sample strategies that you have that demonstrate this?

                      Comment


                        #12
                        Sorry Ken, not aware of any I could point you to that would use this technique, it would come down to custom coding this exit approach.
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          So continuing with this senario, using IOrders and no Set Methods, would this way work?
                          protected override void OnOrderUpdate(IOrder order)
                          {
                          if (buy2entry != null && buy2entry == order){
                          if (order.OrderState == OrderState.Filled){
                          if (buy1target != null)
                          CancelOrder(buy1target);
                          buy2target = ExitLongLimit(0, true, 2, Position.AvgPrice + 4 * TickSize, "Buy_1&2_Profit", "");
                          } } }

                          Comment


                            #14
                            Hello kenb2004,
                            Yes, it would work fine.

                            Please let me know if I can assist you any further.
                            JoydeepNinjaTrader Customer Service

                            Comment


                              #15
                              From the code in post#13, how would you make the quantity a "catch-all" like the tag " " ?
                              Thanks
                              Code:
                              [FONT=Courier New]buy2target = ExitLongLimit(0, true, [COLOR=red][B]2[/B][/COLOR], Position.AvgPrice + 4 * TickSize, "Buy_1&2_Profit", ""); [/FONT]

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by gbourque, Today, 06:39 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post gbourque  
                              Started by cmtjoancolmenero, Yesterday, 03:58 PM
                              1 response
                              17 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by benmarkal, Yesterday, 12:52 PM
                              3 responses
                              23 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by helpwanted, Today, 03:06 AM
                              1 response
                              20 views
                              0 likes
                              Last Post sarafuenonly123  
                              Started by Brevo, Today, 01:45 AM
                              0 responses
                              12 views
                              0 likes
                              Last Post Brevo
                              by Brevo
                               
                              Working...
                              X