이 전략은 여러 가지 다른 변수 설정의 EMA 평균선과 EOM 양력 지표를 결합하여 여러 시간 주기 트렌드 판단을 구현하고, 긴 선과 짧은 선의 공동 판단을 구축하는 거래 전략이다. 이 전략은 다양한 주기 평균선의 여러 시간 주기 공명기를 사용하여 더 효과적인 트렌드 움직임을 발견하는 것을 목표로 한다.
이 전략은 4개의 그룹으로 구성된 4개의 다른 주기의 파라미터 EMA 평균선을 사용한다. 각각 13주기, 21주기, 50주기, 180주기 EMA이다. 이 4개의 그룹으로 구성된 EMA 평균선은 가격의 흐름을 판단하고 더 오래 지속되는 트렌드 패턴을 찾아내기 위해 여러 시간 차원을 구성한다.
전략은 EOM 양력 지표를 사용하여 트렌드를 확인한다. EOM 지표는 거래량과 가격 변동의 폭을 결합하여 구매력 경로를 효과적으로 판단할 수 있다. 전략은 EOM이 0보다 크면 다단 시장이며, EOM이 0보다 작으면 공백 시장이라고 판단한다.
전략 설정 두 가지 옵션, 옵션 1은 단기 EMA에 장기 EMA를 통과할 때 더 많이하고, 단기 EMA에 장기 EMA를 통과할 때 평소한다. 옵션 2은 단기 EMA에 중기 EMA를 통과할 때 더 많이하고, 단기 EMA 아래 중기 EMA를 통과할 때 평소한다. 두 가지 옵션은 더 포괄적으로 추세를 판단할 수 있다.
이 전략은 다중 시간 주기의 EMA 판단과 양 에너지 지표 필터를 통합하여 트렌드 추적과 노이즈 제거를 구현한다. 최적화 할 여지가 많으며, 다른 파라미터 조합을 테스트하고 더 많은 지표를 추가함으로써 전략의 안정성을 더욱 향상시킬 수 있다. 동적 스톱로스 및 포지션 관리도 전략의 성능을 크게 최적화 할 수 있다.
/*backtest
start: 2022-10-02 00:00:00
end: 2023-10-08 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/
// © SoftKill21
//@version=4
strategy("4x ema + volume", overlay=true,initial_capital = 1000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent , commission_value=0.1 )
//ema x 4
ema1l=input(13)
ema2l=input(21)
ema3l=input(50)
ema4l=input(180)
ema1=ema(close,ema1l)
ema2=ema(close,ema2l)
ema3=ema(close,ema3l)
ema4=ema(close,ema4l)
long1 = close > ema1 and ema1 > ema2 and ema2> ema3 and ema3 > ema4
long2 = crossover(ema1,ema2) and crossover(ema1,ema3)
short1 = close < ema1 and ema1 < ema2 and ema2< ema3 and ema3 < ema4
short2= crossunder(ema1,ema2) and crossunder(ema1,ema3)
//eom
length = input(14, minval=1)
div = input(10000, title="Divisor", minval=1)
eom = sma(div * change(hl2) * (high - low) / volume, length)
option1=input(true)
option2=input(false)
if(option1)
strategy.entry("long",1,when=long1 and eom>0)
strategy.close("long",when=short1 and eom<0)
if(option2)
strategy.entry("long",1,when=long2 and eom>0)
strategy.close("long",when=short2 and eom<0)