The DCA Ladder System
DCA (Dollar-Cost Averaging) is the strategy of buying more shares of an asset as its price drops, lowering your average cost basis. SignalPipe implements a full DCA ladder system that automatically manages this process.
How the Ladder Works
Each deal starts at ladder level 1 (the base order). Every time a new buy signal fires for the same ticker while the deal is active, a safety order is placed, moving the ladder to the next level.
| Ladder Level | Order Type | What Happens |
|---|---|---|
| 1 | Base Order | Initial buy that opens the deal |
| 2 | Safety Order #1 | First DCA buy -- averages down entry |
| 3 | Safety Order #2 | Second DCA buy -- averages down further |
| 4 | Safety Order #3 | Third DCA buy |
| ... | ... | Continues for each new buy signal |
Weighted Average Entry Price
The core of the DCA system is the weighted average entry price calculation. After each safety order, the average is recalculated:
new_avg_entry = (old_total_cost + new_order_cost) / new_total_shares
Where:
old_total_cost= previous avg entry price previous total sharesnew_order_cost= safety order fill price safety order sharesnew_total_shares= previous total shares + safety order shares
Take-Profit Recalculation
Every time the average entry price changes, the take-profit target is recalculated:
new_tp_price = new_avg_entry * (1 + tp_percent / 100)
The old limit sell order on Alpaca is cancelled and a new one is placed at the updated TP price for the updated total share count.
DCA Ladder Example
Assume a 5% take-profit setting and a base order of 10 shares:
| Step | Action | Price | Shares | Total Shares | Avg Entry | TP Target |
|---|---|---|---|---|---|---|
| 1 | Base order | $100.00 | 10 | 10 | $100.00 | $105.00 |
| 2 | Safety #1 | $90.00 | 15 | 25 | $94.00 | $98.70 |
| 3 | Safety #2 | $85.00 | 22 | 47 | $89.26 | $93.72 |
- After the base order, the price needs to reach $105.00 for a 5% profit
- After safety order #1, the TP drops to $98.70 -- already below the original entry price
- After safety order #2, the TP drops further to $93.72
The more the price drops and the more safety orders are filled, the closer the TP target moves to the current price. This dramatically increases the probability of the take-profit being reached.
Safety Order Volume Scaling
The vyn premium strategy supports a Safety Order Volume Scale setting. This multiplier increases the dollar amount of each successive safety order. For example, with a scale of 1.5x:
- Base order: $1,000 worth of shares
- Safety #1: $1,500 worth of shares
- Safety #2: $2,250 worth of shares
Larger safety orders at lower prices have a greater impact on bringing down the average entry, but they also increase total capital commitment. Choose a scale that matches your risk tolerance and account size.
Race Condition Protection
When a safety order signal arrives, SignalPipe checks whether the existing take-profit order has already been filled before attempting to cancel it. If the TP was filled (meaning the position was sold), the deal is marked as completed and the safety order is not processed. This prevents placing a buy order for a position that no longer exists.