This strategy adopts the Bollinger Bands indicator and moving average to determine trading signals. The Arnoud Legoux indicator is used to calculate the moving average, combined with the Parabolic SAR indicator to judge the entry signals. The strategy name is “Double Moving Average Crossover Strategy”, containing both the moving average indicator and the double line condition judgment characteristics.
The core logic of this strategy is to judge the relationship between the Bollinger Bands and the moving average indicator. It uses the Bollinger Bands with a certain width of moving average bands to determine the long and short signals when the moving average line crossovers.
Specifically, the strategy combines the Arnoud Legoux moving average indicator and the Parabolic SAR indicator.
The Arnoud Legoux moving average indicator is an improved version based on the traditional moving average. Compared with the ordinary moving average, it introduces the Offset displacement to adjust the angle of the moving average line more flexibly. At the same time, the Sigma value is used to adjust the smoothness of the moving average line.
The Parabolic SAR indicator is a very common stop-loss indicator. It can give very clear reversal signals to track the price trend. When the Parabolic SAR indicator is below the price, it represents a bullish state. On the contrary, above the price is a bearish state.
The logic for judging the indicator relationship is as follows:
The logic for judging the short signal is the opposite:
This strategy combines the Bollinger Bands indicator and the moving average indicator to take into account both trend judgment and breakout trading. The main advantages are:
There are also some risks in this strategy:
The corresponding solutions are:
There are many directions for optimizing this strategy:
This strategy uses the double judgment of Bollinger Bands and moving average indicators. There is a large space for optimization in terms of parameter tuning and strategy combination. By introducing more quantitative methods, the strategy can be further optimized into a stable profit-generating algorithmic trading strategy.
/*backtest start: 2023-11-26 00:00:00 end: 2023-12-26 00:00:00 period: 1h basePeriod: 15m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=3 //Author: HighProfit //Lead-In strategy("Parabolic SAR & Arnoud Legoux Moving Avarage Strategy", shorttitle="ST-PSAR+ALMA", overlay=true) //Arnoud Legoux Moving Avarage Inputs source = close windowsize = input(title="Window Size",defval=50) offset = input(title="Offset", type=float, defval=0.85) sigma = input(title="Sigma", type=float, defval=6) //Parabolic SAR Inputs start = input(title="Start", type=float, defval=0.02) increase = input(title="Increase", type=float, defval=0.02) max = input(title="Max", type=float, defval=.2) //Conditions longCondition = close>open and sar(start, increase, max) < low and crossover(close, alma(source, windowsize, offset, sigma)) if (longCondition) strategy.entry("Long", strategy.long) shortCondition = close<open and sar(start, increase, max) > high and crossunder(close, alma(source, windowsize, offset, sigma)) if (shortCondition) strategy.entry("Short", strategy.short) //Plots plot(alma(source, windowsize, offset, sigma), linewidth=2, title="ALMA") plot(sar(start, increase, max), style=circles, linewidth=2, title="PSAR")