Page cover

DCA

📌 Standard Deviation DCA Strategy

Automated position building using statistical price bands

A smart accumulation algorithm that executes buy/sell orders when price deviates significantly from its mean, with flexible order sizing and LIFO profit-taking options.


⚙️ Core Parameters

Parameter
Example
Description

Amount

5000

Target token volume

Order_size_min

50

Base order size (in tokens)

Price_Low

2

Lower price boundary

Price_High

4

Upper price boundary

Period

1d

Order triggering frequency

Window_Size

21

Candles for mean/std calculation

Buy_Threshold

3

Buy when price < (mean - 3σ)

Sell_Threshold

2

Sell when price > (mean + 2σ)


📊 Order Sizing Modes

1. Classic

  • Fixed-size orders: Order_size_min tokens per trade

2. Martingale

  • Order size increases exponentially from Price_High to Price_Low

3. Logarithmic

  • Calculated per:

    Order_size(n) = Order_size_min * multiplier * ln(n+1)

    Where:

    • S = Order_size_min

    • M = Multiplier (e.g., 1.05)

    • n = Trade count


📌 Example: Buying TON with SD-DCA

Setup:

  • Mean price: 3.00,σ=3.00,σ=0.20

  • Buy trigger: 3.00−(3×3.00−(3×0.20) = $2.40

  • Log mode: M=1.05, S=50 TON

Execution:

  1. Trade #1 at $2.40:

    • Size = 50 × (1 + 1.05×ln(1)) = 50 TON

  2. Trade #5 at $2.20:

    • Size = 50 × (1 + 1.05×ln(5)) = 131 TON

LIFO Selling:

  • If price rebounds to $2.80 (mean + 2σ):

    • Sells most recent buy first


🔍 Key Features

Statistical edge - Buys at statistically "low" prices ✅ Flexible scaling - Choose risk profile via order sizing ✅ Auto-profit taking - LIFO selling locks gains


🛡 Risk Controls

✔ Price boundaries prevent extreme executions ✔ Configurable σ thresholds adjust sensitivity ✔ Real-time PnL tracking


📊 Performance Tracking

  • Realized PnL per closed position

  • Net average entry price

  • Missed signal diagnostics


🔥 Ideal For:

  • Accumulating during market dips

  • Mean-reversion strategies

Last updated