Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Unmanaged -- "Enforce Partial Fills" - not working?

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

    Unmanaged -- "Enforce Partial Fills" - not working?

    Hi NT -

    Does "Enforce Partial Fills" simulation work for UnManaged trades?

    If it does work for UnManaged trades what am I doing wrong? Is there another setting that I'm missing?

    I am using the UnManaged approach (i.e. IsUnmanaged = true) and I have selected "Enforce Partial Fill" from Tools-> Options -> Trading->Enforce partial fills (selected).

    I've tried a wide range of dates to "catch" a PartFilled state but ALL orders are getting filled. I have tried Market and Limit orders and I don't see any PartFills.

    Big Surf

    #2
    Originally posted by bigsurftrader View Post
    Hi NT -

    Does "Enforce Partial Fills" simulation work for UnManaged trades?

    If it does work for UnManaged trades what am I doing wrong? Is there another setting that I'm missing?

    I am using the UnManaged approach (i.e. IsUnmanaged = true) and I have selected "Enforce Partial Fill" from Tools-> Options -> Trading->Enforce partial fills (selected).

    I've tried a wide range of dates to "catch" a PartFilled state but ALL orders are getting filled. I have tried Market and Limit orders and I don't see any PartFills.

    Big Surf
    If you run a market replay and choose the Historical radio button, that guy will give all partial fills, on every entry, at least for futures trading three contracts. Don't know why it does that but it does and it's really handy when you're trying to code for partial fills. I code in managed mode but it would probably do it for unmanaged. It's worth a try anyway.

    Comment


      #3
      Thank you very much for the tip! I'll try it first thing in the morning. Night :-)

      Comment


        #4
        Is there a way to capture Partfills when running a Strategy?

        Comment


          #5
          This is what I do in OnExecution to keep track of the PnL:
          Code:
                 Trade lastTrade = null;
          
                  if( e.IsExitStrategy
                      || e.IsExit )
                  {
                      if( State == State.Realtime
                          && SystemPerformance.AllTrades.Count > 0 ) 
                      {
                          lastTrade = SystemPerformance.AllTrades[SystemPerformance.AllTrades.Count - 1];
                          if( lastTrade != null )
                          {
                              if( e.Order.OrderState == OrderState.Filled
                                  && e.Order.Filled > 0 )
                              {
                                  if (lastTrade.ProfitCurrency > 0)
                                  {
                                      // Add 'em up
                                  }
                              }
                              else if( e.Order.OrderState == OrderState.PartFilled )
                              {
                                  if (lastTrade.ProfitCurrency > 0)
                                  {
                                      // Add 'em up
                                  }
                              }
                          }
                      }
                  }
          I was hoping Ninja would answer because this isn't quite right. It works most of the time but I'm missing something. I wonder if say you have a part fill that requires two tries at it, one them goes through OnExecution but the other one doesn't. I got part filled on the exit just this morning and my calculations were off by one contract and I don't understand why.

          Comment


            #6
            Hello

            You can utilize the following example which shows one way of checking for part fills: http://ninjatrader.com/support/forum...ead.php?t=7499

            In traderpards post, you can see the use of OrderState.PartFilled, this would be the same process or check the State of the order. What you do with that information would be up to you, but this would be how to access it.


            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Hi Jesse - the link does not answer my question. I am trying to simulate "PartFill" from a strategy analyzer and it's not simulating the partial fills. I've tried up to 2 years of trades and zero part fills.

              How can we simulate partial fills?

              Comment


                #8
                Here's my original post:
                Hi NT -

                Does "Enforce Partial Fills" simulation work for UnManaged trades?

                If it does work for UnManaged trades what am I doing wrong? Is there another setting that I'm missing?

                I am using the UnManaged approach (i.e. IsUnmanaged = true) and I have selected "Enforce Partial Fill" from Tools-> Options -> Trading->Enforce partial fills (selected).

                I've tried a wide range of dates to "catch" a PartFilled state but ALL orders are getting filled. I have tried Market and Limit orders and I don't see any PartFills.

                Big Surf

                Comment


                  #9
                  Bumping this thread as I think others are also interested in the response.

                  Comment


                    #10
                    Hello,

                    Thank you for the reply.

                    In reference to your original question, Yes the enforce partial fills option is specifically for the simulator account and the order methods you can use to submit orders which would include the unmanaged approach.

                    You would not see partial fills in Historical data specifically, but using any of the play forward modes such as Realtime data, Market Replay or the Simulated data feed you would be able to simulate partial fills if a partial fill could happen at that point in time. Historically you would not be able to simulate partial fills using tools like a Backtest or even just a charts historical data, it would need to play through and have the granularity needed to become a partial fill.

                    Posts #5 and #6 would still be correct for your other question "Is there a way to capture Part fills when running a Strategy?", these posts detail how to capture partial fills which is a different concept from generating a part fill. Causing a partial fill to happen would rely on enforcing partial fills, the quantities used and the volume available at the time of the order.

                    Please let me know if I may be of additional assistance.
                    JesseNinjaTrader Customer Service

                    Comment


                      #11
                      Thanks Jesse - that makes sense. Appreciate it!

                      Big Surf

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by CortexZenUSA, Today, 12:53 AM
                      0 responses
                      1 view
                      0 likes
                      Last Post CortexZenUSA  
                      Started by CortexZenUSA, Today, 12:46 AM
                      0 responses
                      1 view
                      0 likes
                      Last Post CortexZenUSA  
                      Started by usazencortex, Today, 12:43 AM
                      0 responses
                      5 views
                      0 likes
                      Last Post usazencortex  
                      Started by sidlercom80, 10-28-2023, 08:49 AM
                      168 responses
                      2,265 views
                      0 likes
                      Last Post sidlercom80  
                      Started by Barry Milan, Yesterday, 10:35 PM
                      3 responses
                      12 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Working...
                      X