Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Scaling in with multiple targets and modifying quantities

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

    Scaling in with multiple targets and modifying quantities

    Question 1: When I scale into a strategy with two targets, it'll put both targets on the first one. Why can't it use both targets? For example if I have a 2 target strategy with target 1 at +12 and target 2 at +16 and I put the order qty on 1 and put on an order and get filled and then click another order, both my targets are at +12. I have to go to the order tab and change it manually.

    Question 2: if I put a limit order on the DOM with size of 2 and my position size is 2, I can't change the size back to one. I have to cancel it and make a new one. Is this not possible? This is what I get when I try to change the limit order from 2 to 1:




    Thanks!

    #2
    Hello cunparis,
    Unfortunately the scale in stop target will be that of the first order. Instead of scaling in, you can choose to submit a new order with the same ATM strategy (if the quantity is same) or make a new Atm strategy and submit a new order using it.

    Yes, unfortunately you cannot change the stop and target size/quantity of an running Atm Strategy.

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

    Comment


      #3
      Originally posted by NinjaTrader_Joydeep View Post
      Hello cunparis,
      Unfortunately the scale in stop target will be that of the first order. Instead of scaling in, you can choose to submit a new order with the same ATM strategy (if the quantity is same) or make a new Atm strategy and submit a new order using it.

      Yes, unfortunately you cannot change the stop and target size/quantity of an running Atm Strategy.

      Please let me know if I can assist you any further.
      Ok the first I will accept as a limitation of Ninjatrader. I hope you will consider removing this limitation in the future, it really doesn't make sense to me.

      For the second, I'm not modifying the stop & target.. I'm trying to modify the limit order that I put on the DOM myself. Ninja is applying the limitation of not modifying target & stop order quantities to all orders on the DOM, including the ones I put there myself. This limitation doesn't make sense to me.

      Comment


        #4
        Hello cunparis,
        I will forward your suggestion to development.

        You will be able to change the entry order quantity. Can you tell me the exact steps to replicating the error. Also please let me know who your broker/connectivity provider is

        I look forward to assisting you further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Joydeep View Post
          Hello cunparis,
          I will forward your suggestion to development.

          You will be able to change the entry order quantity. Can you tell me the exact steps to replicating the error. Also please let me know who your broker/connectivity provider is

          I look forward to assisting you further.
          1. set up a strategy with two targets
          2. set the order Qty to 1
          3. enter two market orders to get long
          4. click several points above to add a limit short order
          5. click a tick higher to add a 2nd limit short order
          6. now click on one of the limit short orders and then click on the other one to move them together
          7. now click the quantity of the limit short order (2) and try to change it to 1. you will get the error dialog I posted above.


          I'm using TT today.

          Comment


            #6
            Hello cunparis,
            You have not changed the Atm template while placing the new orders. If you de-select the running atm template and select a new atm template can you change the order size?

            Alternatively, you can change the order size from the Order tab in Control Center.
            • Select the working limit order.
            • Double click on the quantity column and change the order size.


            I look forward to assisting you further.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Joydeep View Post
              Hello cunparis,
              You have not changed the Atm template while placing the new orders. If you de-select the running atm template and select a new atm template can you change the order size?

              Alternatively, you can change the order size from the Order tab in Control Center.
              • Select the working limit order.
              • Double click on the quantity column and change the order size.


              I look forward to assisting you further.

              Here is the scenario I'd like to do:

              - put a limit order on the DOM without moving my original target
              - change my mind on that limit order and only do 1 lot instead of 2

              if I cancel that order on the dom and put in a new one for 1 lot, I lose my place in the queue.

              is there a way to do this without using the orders tab? I hate messing with that because if I type in a mistake it could execute right away.

              Comment


                #8
                Hello cunparis,
                Unfortunately you cannot do it from the SuperDom itself. I will forward your feature request to development for future consideration.
                JoydeepNinjaTrader Customer Service

                Comment


                  #9
                  Hi Joydeep, I'm trying to scale into a position with a second atm strategy command and would appreciate some help. The following code shows the first part whereby the initial order is placed 5 ticks below the close of the last bar (no problem there).

                  Now what I want to happen is once the initial position is active it then runs another atmstrategy command setting up a new stop limit order 5 ticks above the close of the last bar. I'm using this code which asks whether the first order has been action and in a long and if true then run the second atm strategy, :

                  AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.StopLimit, Close[1]+5*TickSize, 0,TimeInForce.Gtc, orderId2, atmname, atmStrategyId2);

                  The problem is it's not the second atm strategy code at all. Here is the complete code segment:

                  PHP Code:
                  //1. LONG POSITIONS
                              
                  if (orderId1.Length == && atmStrategyId1.Length == )
                              {
                                  
                                  
                                  
                  tsbtnSell.Enabled true;
                                  
                                  
                  tsbtnBuy.Enabled =true;    
                                  
                                  
                  atmStrategyId1 GetAtmStrategyUniqueId();
                                  
                  orderId1 GetAtmStrategyUniqueId();
                                  
                                  
                                      
                                  
                  //AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Market, 0, 0,TimeInForce.Day, orderId1, atmname, atmStrategyId1);
                                  //AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Limit,  GetCurrentBid(), 0,TimeInForce.Day, orderId1, atmname, atmStrategyId1);
                                  
                  AtmStrategyCreate(Cbi.OrderAction.BuyOrderType.Limit,  Close[1]-5*TickSize0,TimeInForce.GtcorderId1atmnameatmStrategyId1);                
                                  
                              }
                              
                              
                              
                              
                  // Check for a pending entry order
                              
                  if (orderId1.Length 0)
                              {
                                  
                                  
                  string[] entryOrder GetAtmStrategyEntryOrderStatus(orderId1);
                                  
                  // If the entryOrder call can't find the order specified, the return array length will be zero otherwise it will hold elements
                                  
                  if (entryOrder.GetLength(0) > 0)
                                  {
                                      
                  // If the order state is terminal, reset the order id value
                                      
                  if (entryOrder[2] == "Filled" || entryOrder[2] == "Cancelled" || entryOrder[2] == "Rejected")
                                          
                  orderId1 string.Empty;
                                  }
                              } 
                  // If the strategy has terminated reset the strategy id
                              
                  else if (atmStrategyId1.Length && GetAtmStrategyMarketPosition(atmStrategyId1) == Cbi.MarketPosition.Flat)
                                  
                  atmStrategyId1 string.Empty;
                              
                              if (
                  orderId1.Length == && atmStrategyId1.Length == )
                              {
                                  
                  tsbtnSell.Enabled true;
                                  
                                  
                  tsbtnBuy.Enabled =true;
                                  
                                  
                  tsbtnClose.Enabled true;
                                  
                  tsLabel.Text ="" ;
                              }
                              
                          
                  //Second entry scale in    
                              
                          
                  if (atmStrategyId1.Length &&  GetAtmStrategyMarketPosition(atmStrategyId1) == Cbi.MarketPosition.Long)
                                  
                              {    
                              
                              
                  AtmStrategyCreate(Cbi.OrderAction.BuyOrderType.StopLimit,  Close[1]+5*TickSize0,TimeInForce.GtcorderId2atmnameatmStrategyId2);                
                                  
                              }
                              
                              
                  // Check for a pending entry order
                              
                  if (orderId2.Length 0)
                              {
                                  
                                  
                  string[] entryOrder GetAtmStrategyEntryOrderStatus(orderId2);
                                  
                  // If the entryOrder call can't find the order specified, the return array length will be zero otherwise it will hold elements
                                  
                  if (entryOrder.GetLength(0) > 0)
                                  {
                                      
                  // If the order state is terminal, reset the order id value
                                      
                  if (entryOrder[2] == "Filled" || entryOrder[2] == "Cancelled" || entryOrder[2] == "Rejected")
                                          
                  orderId2 string.Empty;
                                  }
                              } 
                  // If the strategy has terminated reset the strategy id
                              
                  else if (atmStrategyId2.Length && GetAtmStrategyMarketPosition(atmStrategyId2) == Cbi.MarketPosition.Flat)
                                  
                  atmStrategyId2 string.Empty;
                              
                              if (
                  orderId2.Length == && atmStrategyId2.Length == )
                              {
                                  
                  tsbtnSell.Enabled true;
                                  
                                  
                  tsbtnBuy.Enabled =true;
                                  
                                  
                  tsbtnClose.Enabled true;
                                  
                  tsLabel.Text ="" ;
                              }
                                  
                          
                          } 
                  any ideas or alternatives?
                  Thanks dj

                  Comment


                    #10
                    Hello djkiwi,

                    Thank you for your post.

                    I am not sure I understand your inquiry here. Is the second order never placed? Or is the second order filled but the ATM Strategy it creates is the wrong one?

                    I look forward to your response.

                    Comment


                      #11
                      Hi Patrick, sorry to be unclear. After the first order is filled nothing happens i.e. the second order is never placed nor is there any error in the log.

                      Cheers
                      DJ

                      Comment


                        #12
                        Hello djkiwi,

                        I am seeing that the first atm strategy has atmStrategyId1 = GetAtmStrategyUniqueId();.
                        I am not seeing this for atmStrategyId2. Is this outside of the code somewhere?

                        Also, if you add a print just before the second AtmStrategyCreate() call does this print show in the output window?
                        Chelsea B.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Perr0Grande, Today, 08:16 PM
                        0 responses
                        2 views
                        0 likes
                        Last Post Perr0Grande  
                        Started by elderan, Today, 08:03 PM
                        0 responses
                        5 views
                        0 likes
                        Last Post elderan
                        by elderan
                         
                        Started by algospoke, Today, 06:40 PM
                        0 responses
                        10 views
                        0 likes
                        Last Post algospoke  
                        Started by maybeimnotrader, Today, 05:46 PM
                        0 responses
                        11 views
                        0 likes
                        Last Post maybeimnotrader  
                        Started by quantismo, Today, 05:13 PM
                        0 responses
                        7 views
                        0 likes
                        Last Post quantismo  
                        Working...
                        X