Type/to search

Quantized Gradual Weighted DCA Trading Strategy

Cryptocurrency
Created: 2023-11-16 11:32:12
Last modified: 3 years ago
1
Follow
1779
Followers

img

Overview

The Quantized Gradual Weighted DCA Trading Strategy is a quantitative trading strategy that combines moving average indicators for signal triggering and gradual weighted dollar cost averaging mechanisms. The strategy aims to achieve relatively stable returns in strongly trending markets through trend identification and cost averaging.

Principles

The strategy consists of three main components:

  1. Entry signal judgement

    It uses fast and slow moving average crossovers as the entry signal. Users can choose between SMA, EMA or HMA for the fast and slow moving averages. When the fast MA crosses above the slow MA, a buy signal is generated. When the fast MA crosses below the slow MA, a sell signal is generated.

  2. Gradual weighted DCA

    After a buy signal, the strategy will immediately open a base position. As price continues to fall, the strategy will gradually increase the size of additional safety positions in a weighted manner. The price of each new safety position will be lowered by a fixed percentage relative to the previous one. Also, the allocated funds for each new safety position will be amplified by a factor.

    This gradual increase in position size allows a form of cost averaging, obtaining a better average cost while keeping risks in control.

  3. Take profit and Stop loss

    When price rises above the take profit line, the strategy will close positions for profit. When price falls below the stop loss line, the strategy will exit positions to control loss.

    The take profit line is fixed at base position average price * (1 + fixed percentage).

    The stop loss line fluctuates based on the last safety position price, fixed percentage below it.

Advantages

  1. Combining trend and cost averaging makes it more stable

    Using trends avoids meaningless whipsaws, and cost averaging provides better entry costs.

  2. Gradual position sizing controls risk

    Fixed amplification of safety position sizes, with re-entry threshold, keeps risk in check.

  3. Real-time used funds monitoring

    Incorporated balance usage indicator prevents over-leveraging and forced liquidations.

  4. Separate TP/SL for each position

    Independent exits allow securing profits and cutting losses.

Risks and Improvements

  1. Price whipsaws can trigger multiple safety orders

    In extreme volatility, multiple unnecessary safety orders may be added, increasing loss. Can optimize safety order re-entry threshold.

  2. Moving average parameters need optimization

    Different instruments need different moving average periods. Parameter tuning required.

  3. TP/SL levels need backtest optimization

    TP/SL ratios determine risk/reward profile. Optimal levels vary.

  4. Add maximum drawdown or holding time based forced exit

    Can test incorporating forced exits based on drawdown or holding time to further limit risks.

Summary

The Quantized Gradual Weighted DCA Trading Strategy combines the advantages of trend trading and cost averaging to produce steady returns in strong trends. With optimized parameters, position sizing and re-entry thresholds, it can achieve stable trades with controlled risk. Applicable for hedge funds, CTAs and market neutral strategies.

Source
Pine
/*backtest
start: 2022-11-09 00:00:00
end: 2023-11-15 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © MGTG

//@version=5
Strategy parameters
Strategy parameters
Strategy
Strategy
Profit currency
Base order Size
Safety order Size
Deal start condition > Trading View custom signal
Entry at Cross Over / Under
Short Moving Average
Period
Long Moving Average
Period
Take profit / Stop Loss
Target profit (%)
Stop Loss (%)
Safety orders
Max safety trades count
Price deviation to open safety orders (% from initial order)
Safety order volume scale
Safety order step scale
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)