Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trading on level 2 values

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

    you guys should have it accessible in the next version ! its a pain in the ass to create very big lists.... mu only consolation is that I only need to do it once every few months....

    Comment


      Chancehero,

      Thank you for the suggestion. I will forward your post to development to consider for the next major release of NinjaTrader.

      Let us know if we can be of further assistance.
      Cal H.NinjaTrader Customer Service

      Comment




        dont reply

        Comment


          question about partial fills,
          its this has been answered, direct me where.

          question:
          im placing an UNMANAGED order
          enter_3 = SubmitOrder(0, OrderAction.Buy, OrderType.Limit, trade_quantity, GetCurrentAsk(),0, "", "LONG: situation 3");

          which is ok,
          now, the problem is that I it very likely that I get a partial fill,
          I want to enter with : trade_quantity = 10 contracts,

          when ever I get a actual position in the market I want to place a stop and profit targets.
          this is what I have uo to now
          if (order.OrderState == OrderState.Filled){

          stop_target = SubmitOrder(0, OrderAction.Sell, OrderType.Stop,trade_quantity,0,stop_price,"","Sto p target: situation 2");

          and same thing for the profit target.


          so if I get
          if (order.OrderState == OrderState.PartFilled){

          what should I do? I know that I will get the part filled before, the filled. should I use something like Position.MarketPosition.ToString(), and then place the initial stop and profit targets, and then simply minus that from the orders? or will it do this automatically?

          thanks

          Comment


            Chancehero,

            With the unmanaged approach you will need to tell the code how many contracts to submit with the Profit Target and Stop Loss orders when you get a partial fill.
            Cal H.NinjaTrader Customer Service

            Comment


              ok, next question,

              if I place 10 orders and they are working , and then:

              1) 4 contracts get filled. so I get a message in the execution:
              protected override void OnExecution(IExecution execution)
              {
              // Remember to check the underlying IOrder object for null before trying to access its properties
              if (execution.Order != null && execution.Order.OrderState == OrderState.PartFilled)
              Print(execution.ToString());
              // see how many contracts were filled:
              int partialfilledcontracts = execution.Quantity; // should get 4 in this value.

              // I then set profit and stop loss for those 4 contracts.
              profit_target = SubmitOrder(0, OrderAction.Sell, OrderType.Limit,partialfilledcontracts ,profit_price,0,"","profit target: situation 2");

              stop_target = SubmitOrder(0, OrderAction.Sell, OrderType.Stop,partialfilledcontracts ,0,stop_price,"","Stop target: situation 2");

              }


              if this makes no sense tell me ! so I can fix this part.
              so now I would have 6 working order to enter the market and 4 that are filled with 4 stop loss and 4 profit targets.

              so if I get an filled order for the remaining 6, then I what message will show up?
              partfilled or filled and what quantity will be associated?
              if its partial fill , I should get 6 contracts
              but if I get filled do I get 6 or the total 10 that I initially placed?

              thanks

              Comment


                Hi Chancehero,

                so if I get an filled order for the remaining 6, then I what message will show up?

                Nothing at this point. Your condition will only trigger when you have a partfilled. if the remaining contracts get filled then you won't have a partfilled being called.

                When you get filled you will have all ten contracts get filled from the original order.
                Cal H.NinjaTrader Customer Service

                Comment


                  ok,

                  so ive been writing something up this morning, and tell me if what I wrote is what I think will take place.

                  1 ) I place an order to enterstoplimit at what ever price. for 10 contracts.

                  2) the on execution will start working getting filled or part filled, the stop loss and profit target will get placed, as the contracts are purchased. so if I get a partial fill for 8 contracts, it places 8 stop loss and profit target.

                  3) once price goes up, or down, and hits my profit target or stop loss, ex: 2 sell at the profit target, then the 2 coresponding stop loss will be canceled?

                  thanks
                  Attached Files

                  Comment


                    Chancehero,

                    Yes, you are correct. The SetStopLoss and SetProfitTargets are submitted with OCO ids and when one gets filled the other will get cancelled.
                    Cal H.NinjaTrader Customer Service

                    Comment


                      and the second point, is that true as well, ?

                      Comment


                        Chancehero,

                        Correct. It will place 8 StopLosses and 8 ProfitTargets
                        Cal H.NinjaTrader Customer Service

                        Comment


                          loosing connection and options

                          ok questions (points 2,3 and 4 have questions, please answer then all ):

                          im trying to figure out what will take place running an automatic strategy if I loose connection or is my conputer crashes (get they results both in connect lost.)

                          there are the changes I have made to the options window (see attachment)
                          events:
                          1)if my strat enters long, and places a stop and limit (oco)

                          2) and power stops, will my order still be going? (will the long, limit and stop still be there, or will everything close?) - I believe that they should still be going, since my connect got lost and I cant cancel these orders but I want to make sure.

                          3( Im still dont have a connection, and during the disconnection time, the order got limit filled, will the stop be canceled ?

                          4) when I reconnect, what should I see?
                          thanks

                          ChanceHero
                          Last edited by chancehero; 10-18-2013, 06:48 AM.

                          Comment


                            connection

                            ok questions (points 2,3 and 4 have questions, please answer then all ):

                            im trying to figure out what will take place running an automatic strategy if I loose connection or is my conputer crashes (get they results both in connect lost.)

                            there are the changes I have made to the options window (see attachment)
                            events:
                            1)if my strat enters long, and places a stop and limit (oco)

                            2) and power stops, will my order still be going? (will the long, limit and stop still be there, or will everything close?) - I believe that they should still be going, since my connect got lost and I cant cancel these orders but I want to make sure.

                            3( Im still dont have a connection, and during the disconnection time, the order got limit filled, will the stop be canceled ?

                            4) when I reconnect, what should I see?
                            thanks

                            ChanceHero

                            Comment


                              Chancehero,

                              Your questions can be answered by seeing the link below on where your orders reside -
                              http://www.ninjatrader.com/support/f...7076#post27076

                              Let me know if you have any further questions about the connection and orders.
                              Cal H.NinjaTrader Customer Service

                              Comment


                                what about question 4) when I reconnect?

                                ex:
                                1) have 1 long ES , with a stop and limit (oco),
                                2) i loose connection
                                3) the order gets filled at the limit,
                                4) at this time I should still have 1 stop rogue order .
                                5) i reconnect, within 3 min, and the program (strategy) is still running, as its on keep running.
                                will:
                                1) the strat recognize the stop and close it? is the Iorder name and all that be lost, so the program has no clue what to do with t his stop and go about its normal business?

                                the post you sent me was about loosing connection, but did not particularly discuss, loosing connection while running a strategy (ninja script).

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                625 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                359 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                105 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                562 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                567 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X