Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Partially Filled SetProfitTarget

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

    Partially Filled SetProfitTarget

    Hi,

    My question refers to the SetProfitTarget() function.

    Upon a complete fill of a Stop entry order I call the SetProfitTarget function as:

    SetProfitTarget(CalculationMode.Ticks, NumPipsTarget);
    I believe this is a limit order, which means partial fills will not be completely automatically handled by NT.

    Now, after a partial fill of a target I get a PendingChange Order automatically by NT (I'm assuming b/c I have the SetProfitTarget in my initialize function with a static number of pips); this order gets rejected b/c "Can't replace below filled quantity). At this point the remaining lots of my position do not get exited until the price reaches the target price that moves to fulfills my # of target profit pips.

    This is how I think I should solve this issue.
    I'm assuming I should remove the SetTargetProfit() function from the Initialize() function so a new target doesn't get submitted; I call the SetTargetProfit() function after my entry order gets filled anyway.

    Additionally, I have added code to the OnExecution() function checking for the execution.Order.Name == "Profit target" which exits any remaining position i have in the event of an OderState.PartFilled.

    Thanks for your help / thoughts.

    Anthony
    mrlogik
    NinjaTrader Ecosystem Vendor - Purelogik Trading

    #2
    Not sure I follow. Partial fills should be not a problem, since the target (limit) will be amended accordingly.

    Comment


      #3
      Hey Dierk,

      I'm not sure exactly what is going on. Maybe something I don't understand about NTs internal order handle rules?

      I have attached the section of the log which details this particular order.

      Thanks

      Anthony
      Last edited by mrlogik; 08-14-2008, 06:55 AM.
      mrlogik
      NinjaTrader Ecosystem Vendor - Purelogik Trading

      Comment


        #4
        You need to debug your strategy using e.g. TraceOrders in order to understand why it amends the qty of the profit target below the amount which already is filled.

        Comment


          #5
          got ya.

          The TraceOrders is basically a breakdown of whats being submitted to NT by my strategy right? Like the file I just uploaded?
          mrlogik
          NinjaTrader Ecosystem Vendor - Purelogik Trading

          Comment


            #6
            That is correct.

            Comment


              #7
              Dierk,

              since the target (limit) will be amended accordingly
              How does NT amend this target on a partial fill?

              Thanks
              mrlogik
              NinjaTrader Ecosystem Vendor - Purelogik Trading

              Comment


                #8
                ... based on current strategy position avgprice

                Comment


                  #9
                  What I mean is,

                  The only time I call the SetProfitTarget function is once in the Initialize function, and once after I get an entrance "filled" which is done by the OnExecution() overloaded function checking my IExecution object. After this, I don't amend the SetProfitTarget anywhere in my code.

                  When you say NT amends the target when a partial fill occurs, does it do so because i set a static SetProfitTarget() in the Initialize Function? I don't believe my code tried to change the target order I'm refering to with my question.

                  Is it possible NTs ammended order could get rejected?

                  Thanks,
                  Anthony
                  mrlogik
                  NinjaTrader Ecosystem Vendor - Purelogik Trading

                  Comment


                    #10
                    I see. Please send me again traces and logs. Thanks

                    Comment


                      #11
                      I sent you an email with these files. My account number and such is within the files so I didn't want to post them.

                      Thanks
                      mrlogik
                      NinjaTrader Ecosystem Vendor - Purelogik Trading

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      627 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