Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

dealing with partial fill in strategy

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

    dealing with partial fill in strategy

    how to deal with partial fills in strategies for both managed and unmanaged approach

    (1) safety first
    I always want to be fully protected so for every initial order there should be an attached stop (and profit) at the broker.
    Also for partial filled orders this should be the case. As soon as a primary order is partial filled a protected stop order should be in place on broker side. If the primary order gets a second fill the stop order should be updated.
    But there should not be extra commission. The original order should be commisioned as one even when filled in 2 or more times.
    Most important is that for every primary order there should always be the attached stop in place at brokers side. If primary order is partially filled than also the stop order is updated accordingly.
    So when loosing a connection or crashing of the platform/computer or broker server down you are always protected.

    (2)
    Is it important to program the tracking of the partial fills in the strategy? Or is this taken care of by broker/NT for both managed and unmanaged approach
    I see here the potential for the strategy to get completely confused. For example: what if a primary order never fills completely before its reaches the stop or the profit.
    Are the stop and profit closing the trade for the same amount as the partial filled primary order?
    How is this arranged within NT.?
    How do i need to program this to be completely watertight?
    Are there examples available that deal with this?

    thank you all

    #2
    Hello yeshe,

    Thank you for your post.

    With the Managed Approach this can be achieved via the SetProfitTarget() and SetStopLoss() methods: http://www.ninjatrader.com/support/h...d_approach.htm

    Using the Unmanaged Approach requires submitting and adjusting orders manually based on order and position updates. In this case you need to track the fills.

    The Stop or Target will close the trade for the partially filled amount if either is hit before the entry order is completely filled.

    An example of using OnOrderUpate() and OnExecution() for protective orders can be found at the following link: http://www.ninjatrader.com/support/f...ead.php?t=7499
    For an example of monitoring the Stop Loss and Profit Target please visit the following link: http://www.ninjatrader.com/support/f...ead.php?t=5790

    Please let me know if I may be of further assistance.

    Comment


      #3
      Hello Patrick

      Thank your for your answer. Helpful but not completely solved.

      Let's take an example (and use the managed approach for now):

      Primary order (amount of 100) is executed and partially filled for 50.
      setstoploss() and setprofittarget() are in place

      now a power outage/crash etc is happening

      What will happen:
      1) are the stoploss and profit target set for 50
      2) when still down/crashed but another fill for 25 should happen. Is this automatically happening on broker side?
      Are the amount for the stoploss and profittarget updated to 75 on broker server?
      3) In case the outage is an internetconnection loss, and now internet comes back:
      how does the strategy recognize the 25 fill which happened during the outage?

      sincerely

      Comment


        #4
        Hello yeshe,

        Thank you for your response.
        Originally posted by yeshe View Post
        What will happen:
        1) are the stoploss and profit target set for 50
        2) when still down/crashed but another fill for 25 should happen. Is this automatically happening on broker side?
        Are the amount for the stoploss and profittarget updated to 75 on broker server?
        3) In case the outage is an internetconnection loss, and now internet comes back:
        how does the strategy recognize the 25 fill which happened during the outage?
        1. Correct, the Stop Loss and Profit Target are set at the filled amount before the disconnect/outage.
        2. Unfortunately, no. The order would be adjusted by NinjaTrader, the broker will only see the orders' quantity based on what they were set to before the outage.
        3. The strategy can re-calculate the position upon re-connect based on the settings available under Tools > Options > Strategies > NinjaScript > On Connection Loss: http://www.ninjatrader.com/support/h...tegies_tab.htm

        Please let me know if I may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        650 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 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
        577 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X