DCA bot take-profit recalculation after fills should use the deal's confirmed entry quantity and acquisition cost, then apply the chosen profit rule to that updated state. A submitted or partly filled safety order does not justify using its full planned amount. Recalculate the target price and the quantity to exit separately, and verify that the exchange's active order reflects both.
A target can move correctly on the bot's screen while an older sell order remains active. The useful audit therefore follows two records: what the deal actually owns, and what the exchange is currently instructed to sell. The worksheet below keeps them connected without treating a lower target as proof that the deal has become safer.
Define the target rule before updating it
For this article, assume an unleveraged spot deal with no previous sales. Its exit rule seeks a fixed gross percentage of all acquisition notional. This is one explicit convention, not a universal definition of a DCA take-profit setting.
Let Q be the base units acquired and C the quote currency spent on those units, excluding fees. Then:
Average entry A = C / Q
Target price T = A × (1 + r)
Here r is the selected gross target percentage expressed as a decimal. A 2% target uses r = 0.02. If Q = 0, there is no average entry or inventory-backed exit target; a controller should not divide by zero or create a sell from a prospective purchase.
Other rules can target a fixed quote profit, a percentage of the initial purchase budget, or an original entry price. Their revisions differ. Identify the active rule before interpreting a changed target. The fee-inclusive take-profit worksheet handles profit bases and net-cash calculations; the focus here is when confirmed entry fills change the inputs.
Recalculate on fills, including an unfinished purchase
For each newly confirmed entry fill with quantity q and execution price p, update:
Q_new = Q_old + q
C_new = C_old + q × p
T_new = (C_new / Q_new) × (1 + r)
An exchange acceptance adds an instruction, not acquired inventory. Binance's Spot API glossary defines executedQty as filled quantity and cummulativeQuoteQty as the sum of price times quantity across an order's fills. These fields distinguish execution from the requested amount.
For an order with multiple fills, use its actual accumulated cost and quantity. Binance's user-data stream documentation explains that an order's average execution price is cumulative quote quantity divided by cumulative filled quantity. That is an order average; a deal with several entry orders still needs their combined cost and quantity.
Avoid adding the same cumulative snapshot repeatedly. If one update says an order has filled 1 unit and a later update says 2 units, the second update adds 1 unit, not 2. Either rebuild the deal from its unique fills or apply reconciled increases to previously recorded cumulative values.
Planned safety quantities can also change when venue increments are applied. The safety-order volume-rounding comparison shows why ideal scheduled quantities can differ from submitted ones. Neither quantity belongs in the acquired inventory column until it actually fills.
Follow four entry states through one target
This hypothetical deal uses a 2% gross target on total acquisition notional. The quote currency is called dollars for readability. All listed fills occur at the stated prices. Fees, slippage, funding, taxes and previous exits are excluded. Assume the market permits the quantities shown and a $0.01 price tick.
The first safety purchase requests 2 units. It executes in two parts: 1 unit at $90 and 1 at $89. A later purchase adds 2 units at $80. The table shows the desired exit after each confirmed entry state, before any sale.
| Confirmed entry state | New fill cost | Cumulative units Q | Cumulative cost C | Average entry C / Q | Exact gross target | Target at $0.01 tick |
|---|---|---|---|---|---|---|
| Base: 2 units at $100 | $200 | 2 | $200 | $100.0000 | $102.000 | $102.00 |
| Safety purchase, first 1 unit at $90 | $90 | 3 | $290 | $96.6667 | $98.600 | $98.60 |
| Safety purchase, remaining 1 unit at $89 | $89 | 4 | $379 | $94.7500 | $96.645 | $96.65 |
| Next purchase: 2 units at $80 | $160 | 6 | $539 | $89.8333 | $91.630 | $91.63 |
During the first partial purchase, the correct desired exit is 3 units at $98.60. Calculating as if both safety units had filled at $90 would instead use C = $380, Q = 4 and a target of $96.90. That price and quantity describe inventory the deal does not yet own.
For the third row, the example rounds the sell price upward to preserve at least the chosen gross target. Four units at $96.65 produce $386.60, a $7.60 gross gain over $379, slightly above the exact $7.58 target. This rounding policy is an illustrative choice. Binance's Spot filters specify price-tick, quantity-step and minimum-notional constraints; a mathematically valid target still needs to pass the applicable venue rules.
If the unfinished safety remainder is cancelled after the second row, no purchase is added. Quantity stays at 3, cost stays at $290 and the mathematical target stays at $98.60. Cancellation changes future buying authority, not past acquisition cost.
A lower target can accompany more capital at risk
The final target falls from $102 to $91.63, but deployed capital rises from $200 to $539. The target's gross quote profit also rises from $4 to $10.78. A lower recovery price does not make those additional dollars disappear.
Nor must every new entry lower the average. For positive existing and new quantities, the change is:
A_new − A_old = q × (p − A_old) / (Q_old + q)
A fill below the previous average lowers it; one above raises it; one at the average leaves it unchanged. Execution price, rather than a safety-order label, determines the direction.
These are base-quantity-weighted spot calculations. An inverse contract can aggregate entry prices differently because its contract and settlement units differ. Use the inverse-contract average-entry example before transferring this worksheet to a coin-settled position.
Verify the active exit after a target revision
Suppose the first safety unit fills, but the exchange still has the original sell for 2 units at $102. The bot's desired state is now 3 units at $98.60. Both the price and covered quantity are stale at the exchange.
Record a target revision with its fill cutoff, cost, quantity, calculation rule, rounded price and associated exchange order. Compare that desired state with confirmed order status. A requested amendment or replacement is an intermediate step, not evidence that the revised exit is working.
Bybit's cancel-order API documentation states that cancellation acknowledgment is asynchronous and directs clients to confirm order status through WebSocket updates. If replacement is needed, reconcile the previous exit before assuming its quantity is released. The cancel-replace race guide examines the possible outcomes in detail.
A realistic failure occurs when the market rebounds while that revision is in flight. The old sell may execute before its cancellation completes. At that point, stop applying the no-sales table: inventory has changed through an exit as well as an entry. Reconcile the sold units, proceeds and remaining cost before preparing another exit. The partial-fill management guide covers that remaining-order state.
Keep the recalculation reproducible
For each new entry, retain the deal and order identifiers, unique fill references, cumulative quantity, cumulative quote cost, fee amounts and fee assets, calculation timestamp and target revision. Keep the calculated target beside the confirmed active exit quantity and price. An unexplained mismatch is a reconciliation task before it is a reason to tune the percentage.
The worksheet deliberately excludes fee effects. A commission deducted in base units can reduce sellable inventory; quote fees and other costs can change a net-profit target. Apply the documented cost convention consistently rather than silently switching between gross entry price and net break-even.
This AI-assisted article provides an educational audit method, not a claim that KLINEO or every venue implements this target rule. Its synthetic fills isolate how entry updates affect cost, quantity and exit coverage. They do not model a profitable configuration or establish that a calculated target will fill.
