Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

entering stops for multiple fills

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

    entering stops for multiple fills

    hello
    i am placing my stop orders in the
    protected
    overridevoid OnExecution(IExecution execution) function.

    if i get multiple fills, i want to ensure that i have only 1 stop order that matches the entire fill. how do i do that.

    my stop order looks like this and will be called in for every execution that matches SIGNAL_ENTRY and will be multple if there are multiple fills related to the same entry order.

    ExitLongStop(stopprice, SIGNALEXIT_STOP, SIGNAL_ENTRY);

    #2
    Simply call the ExitLongStop() method again on a new fill and increment the quantity amount. ExitShortStop() of course is used when short.
    RayNinjaTrader Customer Service

    Comment


      #3
      i just want to get the clear answer.
      for eg.
      i open trade for 1000 as quantity which gets filled in 2 fills
      1. 400
      2. 600

      which will work and which one will not work.

      Solution A.
      so first time, my
      ExitLongStop(stopprice, SIGNALEXIT_STOP, SIGNAL_ENTRY);
      and second time it will be
      ExitLongStop(stopprice, SIGNALEXIT_STOP, SIGNAL_ENTRY);

      Solution B
      ExitLongStop(400,double stopPrice,string signalName, string fromEntrySignal)
      ExitLongStop(600,double stopPrice,string signalName, string fromEntrySignal)

      Comment


        #4
        You want to tailor your stop order quantities to the filled orders you generate...please see this reference sample dealing with checking for fills and updating the Stops and Targets of the strategy - http://www.ninjatrader-support2.com/...ead.php?t=7499

        Comment


          #5
          the area i need additional clarity is here.
          1. stopOrder = ExitLongStop(0, true, stopOrder.Quantity, Position.AvgPrice, "MyStop", "MyEntry");
          2. stopOrder = ExitLongStop(0, true, stopOrder.Quantity, Position.AvgPrice, "MyStop", "MyEntry");

          if i have 2 statements running one after the other, would the #2 modify #1 or would #2 be in addition to #1.
          what info in the order statement diffferentiates if it is a new order or a modification of an existing order.

          Comment


            #6
            It will amend the original order. If you want to scale out with two exit orders you will need to scale in with two entry orders.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            558 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            324 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            545 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            547 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X