Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnExecution() and hanle send order

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

    OnExecution() and hanle send order

    Hi

    When strategy script send Limit order and it filled - OnExecution() work wery good.

    But when:
    - I send Limit order and it filled or
    - I send Market order
    OnExecution() NOT work.

    How write script in strategy for processing executed handle send orders ?

    Thanks

    #2
    Nikoli, I'm not sure I follow what issue you exactly run into - are you trying to add stops and targets once entry orders report filled in OnExecution?

    The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()


    For debugging purposes please also get used to working with TraceOrders, as this is very helpgul to 'look under the hood' of your order processing in the strategy -

    Comment


      #3
      it next task.
      Now I want only controlig filled hand_send_order.

      I wrote in strategy

      protected override void OnExecution(IExecution execution) {
      Print("New exec order OnExecution "+DateTime.Now.ToLongTimeString()); }
      and
      protectedoverridevoid OnPositionUpdate(IPosition position) {
      Print(
      "New exec order OnPositionUpdate "+DateTime.Now.ToLongTimeString()+" "+Position.MarketPosition+" "+ Position.Quantity+" "+Position.AvgPrice );
      Print(position.Instrument.FullName+" "+position.AvgPrice.ToString()+" "+position.Quantity.ToString()+" "+position.MarketPosition);
      Started strategy and hand send market order
      In OutputWindow print
      New exec order OnPositionUpdate 15:49:08 Flat 0 0
      ES 06-10 0 0 Flat
      Why
      OnExecution() not work ?
      and
      OnPositionUpdate() looked position.Instrument and
      NOT looked position.AvgPrice,position.Quantity, position.MarketPosition) ?

      And main question: What can I do for strategy will look it?

      Comment


        #4
        Nikoli, to clarify what you seek to do - are you looking to track manually entered orders from a NinjaScript strategy? This is unfortunately not possible.

        Comment


          #5
          No
          I started strategy
          and after that manualy send market order.
          Of course, order filled and position changed.

          And, very impotant, strategy looked it - OnPositionUpdate started.

          All I want - look in OnPositionUpdate() parametrs of current position after filled order.

          How I can do it?

          Comment


            #6
            Nikoli, when you say 'manually' placed order - does this mean the strategy placed it or you with the ChartTrader, SuperDOM or the Control Center.

            If the strategy placed it you would need to work with IOrders to access fillstates -

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              Nikoli, when you say 'manually' placed order - does this mean the strategy placed it or you with the ChartTrader, SuperDOM or the Control Center.

              If the strategy placed it you would need to work with IOrders to access fillstates -

              http://www.ninjatrader-support.com/H...V6/IOrder.html
              I started strategy and after it

              I send order manually with the ChartTrader, SuperDOM or the Control Center.

              And strategy looked it and started OnPositionUpdate()

              Very impotant, strategy looked it - because OnPositionUpdate() started and print in OutputWindow.


              But OnPositionUpdate() looked position.Instrument
              and
              NOT looked position.AvgPrice,position.Quantity, position.MarketPosition (see print in my post early - it print code from OnPositionUpdate() )

              All I want - look in OnPositionUpdate() parametrs of current position after filled maually send order from SuperDOM.


              And main question: What can I do it in strategy?
              Last edited by Nikoli; 03-19-2010, 08:18 AM.

              Comment


                #8
                Nikoli, unfortunately my earlier comment still applies - accessing manually entered positions (or managing them) from a NinjaScript strategy is not supported. You could call our ATM's for exit management of NinjaScript generated entries, for info on this, please review our 'SampleAtmStrategy' installed per default.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                656 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                371 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                109 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                574 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                579 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X