Type/to search

Dual Moving Average Crossover Trading Strategy

Cryptocurrency
Created: 2023-11-21 12:26:53
Last modified: 3 years ago
1
Follow
1779
Followers

img

Overview

This strategy determines entries and exits based on the crossover signals of dual simple moving averages (SMA). Specifically, the short term SMA has a period of 14, while the long term SMA has a period of 28. A long signal is triggered when the short term SMA crosses over the long term SMA. Conversely, a short signal is triggered when the short term SMA crosses below the long term SMA.

Strategy Logic

  1. Inputs

    • Indicator Settings: Define periods for the fast and slow SMA
    • Take Profit and Stop Loss: Configure percentages for take profit and stop loss
    • Money Management: Set initial capital, commission fees etc.
  2. Variables

    Intermediate variables are defined to store values for take profit price, stop loss price, position sizing etc. This avoids repetitive calculations.

  3. Signal Generation

    SMA crossover is used to determine long and short signals.

  4. Entry Rules

    When an entry signal is triggered, any existing position in the opposite direction is flattened first before a new order is placed based on strategy logic.

  5. Exit Rules

    Take profit and stop loss rules are configured for position exits.

  6. Money Management

    Position sizing is used to manage risk per trade.

Advantages

  1. Simple logic, easy to understand
  2. Controllable drawdowns
  3. Optimizable parameters

Risks and Mitigation

  1. Lagging SMA crossover signals

    Consider shorter SMA periods, or supplement with additional indicators

  2. Increased stop loss risk in ranging markets

    Widen stop loss percentage, or use trailing stops

  3. Suboptimal parameters may amplify losses

    Rigorously backtest and optimize parameters

Enhancement Opportunities

  1. Complement with additional indicators

    E.g. MACD, KD etc to reduce signal lag

  2. Optimize SMA periods

    Test more combinations of short and long SMA periods

  3. Experiment with other take profit/stop loss strategies

    E.g. fixed $ value, trailing stops etc

Conclusion

The strategy has clear and simple logic, promising backtest results, and is easy to operate - suitable for novice traders. There is still room for improvement via additional indicators, money management techniques etc to make the strategy more robust.

Source
Pine
/*backtest
start: 2023-10-21 00:00:00
end: 2023-11-20 00:00:00
period: 4h
basePeriod: 15m
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/
// © BigJasTrades https://linktr.ee/bigjastrades 

// READ THIS BEFORE USE:
Strategy parameters
Strategy parameters
Indicator Settings
Short SMA Length
Long SMA Length
Compounding
Compounding
Take Profit and Stop Loss
Use Take Profit
Take Profit %
Use Stop Loss
Take Profit %
TRADING WINDOW
Start Date
End Date
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)