Type/to search

Combining Simple Moving Average and Adaptive Moving Average Strategy

Cryptocurrency
Created: 2023-09-14 18:14:34
Last modified: 3 years ago
1
Follow
1781
Followers

This article introduces a quantitative trading strategy that combines Simple Moving Average (SMA) and Adaptive Moving Average (ALMA). This strategy incorporates multiple technical indicators and generates trading signals based on different parameter settings.

I. Strategy Principle

The core of this strategy is the combination of SMA and ALMA with different parameter settings. SMA is a very common trend-following indicator that shows the direction and momentum of the trend by calculating the arithmetic mean of closing prices over a period of time. ALMA is similar to SMA in averaging historical prices, but it adds two adjustable parameters, α and σ, which make it more sensitive to market changes than SMA.

The strategy first calculates three SMAs representing short-term, medium-term, and long-term trends, respectively. At the same time, it calculates three ALMAs to represent the moving averages at different timeframes. The crossovers between SMA and ALMA form multiple sets of indicators. When the short-term SMA crosses over the medium-term SMA, a buy signal is generated. When the short-term SMA crosses below the medium-term SMA, a sell signal is generated. With the adjustable parameters of ALMA, the signals can respond to the market more quickly.

In addition, the Relative Strength Index (RSI) is introduced to assist in identifying overbought and oversold conditions. When RSI is higher than the overbought threshold, the market is considered overbought. In this case, even if the SMA and ALMA generate buy signals, they may be misleading. Similarly, when RSI is lower than the oversold line, sell signals from the indicators may miss rebounds. So the auxiliary judgment of RSI can avoid certain trapping risks.

By comprehensively utilizing the parameter settings of SMA, ALMA, and RSI, as well as the cross combinations between indicators of different parameters, relatively sensitive trading strategy signals can be formed. Also, the overbought and oversold judgments from RSI can further optimize entry timing and reduce trapping probability.

II. Advantages of the Strategy

The biggest advantage of this strategy is the flexible combination and application of indicator parameters. Both SMA and ALMA are flexible in adjusting parameters to represent different types of moving averages. RSI can also control the frequency of signals by adjusting parameters. The combination of these indicators complements each other and forms trading signals, which can optimize the timing of entries.

Compared with a single SMA indicator, ALMA enhances the sensitivity to market changes and can respond to trend reversals faster. Also, the auxiliary RSI judgment further avoids blindly following the signals from the moving averages. Therefore, this strategy overall has relatively strong adaptability and optimization capabilities.

Another advantage is the diversity of signal sources of the strategy. The interactions between SMAs and ALMAs at different timeframes provide multi-layered references for the strategy. This can filter out random market noise to some extent and make the signals more reliable.

In general, this strategy has flexible parameters and generates stable signals, making it suitable for algorithmic trading across different products.

III. Potential Risks

Although this strategy has certain advantages, there are still some risks to note when applying it in practice.

First, overoptimization problems caused by indicator settings. SMA, ALMA, and RSI are freely adjustable, but improper tuning may lead to overoptimization and the inability to adapt to long-term structural changes in the market. This requires cautious parameter settings based on the characteristics of different products, instead of merely pursuing short-term results.

Secondly, the strategy signals may lag. Although ALMA responds faster than SMA, there is still a certain lag. In rapidly changing markets, this may result in missing the optimal entry timing. Here we may consider combining some leading indicators to optimize.

Finally, the contradictory signals from multiple indicators need to be watched out for. At certain times, different indicators may give conflicting indications. This needs clear priority rules based on experience to resolve.

In summary, this strategy is not perfect and still requires continuous adjustment and optimization in practice. But its flexible parameter settings and advantages of multiple indicator combinations make it a viable algorithmic trading system for the long term.

IV. Summary

In this article, we have introduced in detail a quantitative trading strategy that combines SMA, ALMA, and RSI. Through flexible combinations of the indicators, it forms signals that are sensitive to the markets. Compared with single indicators, it has stronger adaptability and noise filtering capabilities. But we also need to pay attention to potential issues like overoptimization, signal lag, and judgment errors. Overall, this strategy is reasonably constructed and can generate stable algorithmic trading signals through continuous optimization.

Source
Pine
/*backtest
start: 2023-09-06 00:00:00
end: 2023-09-13 00:00:00
period: 5m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//The plotchar UP/DOWN Arrows  is the crossover of the fastest MA and fastest IIR MAs
//
//The dots at the bottom are the two simple averages crossing over
//
Strategy parameters
Strategy parameters
═══════════════ Show Fibby MAs ═══════════════
MA-Cross Resolution
MA#1 Length
MA#2 Length
MA#3 Length
SMA LooseSqueeze Percent
═══════════════════ Show IIRs ═══════════════════
IIR Resolution
IIR Squeeze PercentClose
IIR Length 1
IIR Length 2
IIR Length 3
Show IIR1
Show IIR2
Show IIR3
═════════════ Show Parabolic MA Counts ════════════
══════════════ Show Buy/Sell Signals ══════════════
══════════════ Show Background Colors ══════════════
══════════════ Show Debug ══════════════
══ Bar Lookback Period ══
══ Percentage Lookback Period ══
══════════ Show misc MA Cross Strategy ══════════
IIRx Length:
IIRx Period/TF:
IIRx2 Length:
IIRx2 Period/TF:
Alma of IIR1 Period:
Alma Alpha Value:
Alma Sigma Value:
═══════════════════ Show RSI Arrows ═══════════════════
RSI Source
RSI Length
RSI Overbought Level
RSI Oversold Level
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)