
이 전략은 평행선 시스템을 사용하여 트렌드 방향을 판단하고, 변동률 지표와 결합하여 낮은 변동성이있는 흔들리는 시장을 피하고, 흔들리는 손실을 사용하여 거래 관리를 한다.
이 전략은 빠른 평균선과 느린 평균선의 위치 관계를 비교하여 트렌드 방향을 판단한다. 빠른 평균선에서 느린 평균선을 통과할 때 더 많이 보고, 아래로 내려다보고 있다. 시장의 흔들림을 피하기 위해, 전략은 브린 밴드 지표를 도입하기도 한다. 브린 밴드의 폭의 변화율을 계산하여, 변화율이 설정된 ?? 값을 초과할 때 거래가 발생한다. 마지막 신호, 전략은 데리 공중 전략의 통로를 흔들림 스톱로써 사용하며, 흔들림 시장에 갇히지 않도록 한다.
특히, 전략의 거래 논리는 다음과 같습니다.
빠른 평균선 (기본 20일) 과 느린 평균선 (기본 50일) 을 계산한다.
브린 띠의 폭 변화율을 계산하기 (기본 40일, 표준 차이의 2배)
빠른 평균선에서 느린 평균선을 통과하고, 브린 대역폭 변화율이 설정된 임계값 (<%9의 기본값) 을 초과하면, 다중 헤드 신호가 생성된다.
빠른 평균선 아래에서 느린 평균선을 통과하고, 브린 대역폭 변화율이 설정된 임계값 (<%9의 기본값>) 을 초과하면 공중 신호가 발생한다.
데리 공중 통로를 스톱 로즈로 계산한다.
다중 상위 손실은 최고 가격으로 ATR*곱하기, 공백 상쇄 손실은 최저 가격 + ATR*곱하기.
평균선 시스템을 사용하여 트렌드 방향을 판단하여 트렌드를 효과적으로 추적할 수 있다.
부린 대역폭 변화율을 도입하면 시장의 흔들림을 방지하고 불필요한 거래를 줄일 수 있다.
진동 제지 (震動止損) 를 적용하여 진동에 갇히지 않도록 적시에 진동을 막아낼 수 있다.
다양한 매개 변수를 조정할 수 있으며, 다른 시장에 맞게 최적화할 수 있다.
전략 논리는 명확하고 이해하기 쉽고, 사용하기 쉽게 학습한다.
평선 시스템에는 지연이 존재하고, 빠른 회전 기회를 놓칠 수 있다.
부린밴드 파라미터를 잘못 설정하면 유효한 거래 신호를 필터링할 수 있다.
너무 민감한 충격파는 거래의 빈도를 높일 수 있다.
매개 변수 최적화가 제대로 이루어지지 않으면 포지션 리스크가 발생할 수 있다.
시장의 급격한 변화에 적응할 수 없는 급격한 사건
다른 변수들의 평행선 조합을 테스트하여 최적의 변수를 찾습니다.
다양한 주기에서 브린 대역변수를 테스트하여 최적의 파동 필터링 효과를 찾을 수 있다.
다른 지표와 결합하여 진입 확인을 통해 신호 품질을 향상시킬 수 있다.
동적 상쇄 전략이 도입되어 상쇄가 시장을 더 잘 추적할 수 있습니다.
기계 학습 기술을 결합하여 자동 최적화 매개 변수를 적용하여 시장 변화에 적응할 수 있다.
이 전략은 평행선 시스템, 브린 벨트 지표 및 흔들림 상쇄 기술을 통합하여 비교적 안정적인 트렌드 추적 시스템을 형성한다. 변수 최적화를 통해 좋은 전략 효과를 얻을 수 있다. 그러나 여전히 트렌드 반전과 시장의 흔들림의 위험을 경계해야 한다. 또한 기계 학습과 같은 기술은 전략의 안정성을 더욱 향상시킬 수 있다.
/*backtest
start: 2022-10-11 00:00:00
end: 2023-10-17 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/
// © juanchez
//@version=4
strategy("CHI", overlay = true, close_entries_rule = "ANY")
n = input(title= "highest high o lowest low period", defval= 22)
f= input(title= "multiplicador", defval= 4)
long = highest(high, n) - atr(n)*f
short= lowest(low, n) + atr(n)*f
plot(long, color= color.red)
plot(short, color= color.green)
//moving averages
period= input(title= "moving averages period", defval= 50)
period2= input(title= "moving averages period2", defval= 20)
type= input(title= "moving averages type", options= ["sma", "ema"], defval= "ema")
//moving average function
mo(p, t) =>
if t == "sma"
sma(close[barstate.islast ? 1: 0], p)
else if t== "ema"
ema(close[barstate.islast ? 1: 0], p)
m= mo(period, type)
m2= mo(period2, type)
trend= m2 > m
plot(m, color = color.maroon, linewidth = 3)
plot(m2, linewidth= 3)
//BOLLINGER BANDS ENTRIES
bb1_period= input(title= "Bollinger bands 1 period", defval=40, minval=1)
bb1_source=input(title="Bollinger band 1 source", defval=close)
bb1_multi=input(title="Bollinger Bands 1 factor", defval=2, minval=1, step=0.1)
show_bb1= input(title="Show Bollinger bands 1", defval=false)
//BOLLINGER BANDS
_bb(src, lenght, multi)=>
float moving_avg= sma(src[barstate.islast? 1: 0], lenght)
float deviation= stdev(src[barstate.islast? 1: 0], lenght)
float lowerband = moving_avg - deviation*multi
float upperband = moving_avg + deviation*multi
[moving_avg, lowerband, upperband]
[bb1, lowerband1, upperband1]= _bb(bb1_source, bb1_period, bb1_multi)
//FIRST BAND
plot(show_bb1? bb1 : na, title="BB1 Moving average", linewidth= 3, color= color.fuchsia)
plot(show_bb1? upperband1 : na, title="BB1 Upper Band", linewidth= 3, color= color.green)
plot(show_bb1? lowerband1 : na, title="BB1 Lower Band", linewidth= 3, color= color.red)
//BB's Width threshold
thresh= input(title= "widen %", defval= 9, minval = 0, step = 1, maxval= 100)
widht= (upperband1 - lowerband1)/bb1
roc= change(widht)/widht[1]*100
cross=crossover(roc, thresh)
// entry
//long
elong= input(true, title= "enable long")
longcondition= m2 > m and cross and elong
//short
eshort= input(true, title= "enable short")
shortcondition= m2 < m and cross and eshort
plotshape(longcondition? true: false , location= location.belowbar, style= shape.labelup, size= size.small, color= color.green, text= "Buy", textcolor= color.white)
plotshape(shortcondition? true: false , location= location.abovebar, style= shape.labeldown, size= size.small, color= color.red, text= "Sell", textcolor= color.white)
out= crossunder(close, long)
outt= crossover(close, short)
strategy.entry("long", strategy.long, when = longcondition)
strategy.close("long", when = out)
strategy.entry("short", strategy.short, when = shortcondition)
strategy.close("short", when = outt)