本策略结合了双指数移动平均线和阿尔玛指标来实现趋势跟踪和入场。其中,阿尔玛线作为主要的趋势过滤器,当价格在阿尔玛线之上做多,当价格在阿尔玛线之下做空。双指数移动平均线用于给出提前的趋势信号以便及早入场。
解决方法: 1. 适当调整双指数移动平均线的周期,降低误信号率。 2. 调整阿尔玛线的参数,降低滞后性。 3. 做好参数优化,找到最佳参数组合。
本策略结合双指数移动平均线和阿尔玛指标,实现了趋势的及时跟踪和可靠的入场过滤。通过参数优化和止损策略的改进,可以进一步减少误信号,控制风险,提高策略效果。该策略适用于趋势性行情,特别是中长线交易。
/*backtest
start: 2022-12-15 00:00:00
end: 2023-12-21 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
//Author: HighProfit
//Lead-In
strategy("Double Exponential Moving Avarage & Arnoud Legoux Moving Avarage Strategy", shorttitle="ST-DEMA+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)
//Exponential Moving Avarage Inputs
L1= input(5,"EMA-1")
L2= input(10,"EMA-2")
//Exponential Moving Avarage Calculations
e1= ema(close, L1)
e2= ema(close, L2)
//Conditions
longCondition = e1 and e2 > alma(source, windowsize, offset, sigma)
if (longCondition)
strategy.entry("Long", strategy.long)
shortCondition = e1 and e2 < alma(source, windowsize, offset, sigma)
if (shortCondition)
strategy.entry("Short", strategy.short)
//Plots
plot(alma(source, windowsize, offset, sigma), color=lime, linewidth=1, title="ALMA")
plot(e1, color=orange, linewidth=1, title="EMA-1")
plot(e2, color=blue, linewidth=1, title="EMA-2")