
V형 반전 지표 SMA 전략은 주가 가격의 14일 최고 가격과 전날 최저 가격의 절대적 차이를 계산하고 14일 최저 가격과 전날 최고 가격의 절대적 차이를 계산한 다음 14일 간단한 이동 평균을 각각 계산하여 VI+ 및 VI- 곡선을 형성한다. VI+ 위를 VI-를 통과할 때 다중 머리 신호. VI- 아래를 VI+를 통과할 때 공백 신호.
이 전략의 핵심 지표는 VI+와 VI-이다. 그 중 VI+는 다중 머리 힘을, VI-는 공중 머리 힘을 나타낸다. 구체적인 계산 공식은 다음과 같다:
VMP = SUM(ABS(HIGH - LOW[1]),14)
VMM = SUM(ABS(LOW - HIGH[1]),14)
STR = SUM(ATR(1),14)
VI+ = VMP/STR
VI- = VMM/STR
곡선의 흔들림을 제거하기 위해, VI+와 VI-에 대해 각각 14일 간소 이동 평균을 계산하여 SMA ((VI+) 와 SMA ((VI-) 를 얻는다. SMA ((VI+) 위에 SMA ((VI-) 를 통과하면 다중 머리 신호가 발생하고, SMA ((VI-) 아래 SMA ((VI-) 를 통과하면 공백 신호가 발생한다.
또한, 전략은 VI+와 VI-의 상향 하향 상태를 결합하여 트렌드를 판단하여 필터링을 수행하여 트렌드가 하향일 때만 더 많이하고, 트렌드가 상향일 때 공백을 다.
이 전략은 트렌드 상태와 VI 지표의 골드 포크 데드 포크를 결합하여 가짜 신호를 효과적으로 필터링하여 수익률을 높일 수 있습니다. 간단한 이동 평균 전략에 비해 파격 신호가 더 신뢰할 수 있습니다.
이 전략에는 두 가지 위험 요소가 있습니다.
VI 지표는 특정 주기에 걸쳐 잘못된 신호를 생성할 수 있습니다. 이 경우 트렌드 필터링과 스톱 손실을 결합하여 위험을 제어해야합니다.
거래 수수료와 슬라이드 포인트 비용이 높은 시장은 이 전략에 적합하지 않으며 수익을 크게 줄일 수 있습니다.
이 전략은 다음과 같은 부분에서 최적화될 수 있습니다.
VI 지표의 주기 변수를 최적화하여 최적의 변수 조합을 찾습니다.
기계학습 방법을 사용하여 잘못된 신호를 자동으로 식별하여 신호 품질을 향상시킵니다.
단편 거래 손실을 통제하기 위한 최적화된 탈퇴 메커니즘과 함께 스톱 손실과 자금 관리
거래 종류를 최적화하여 거래 비용이 낮은 시장을 선택하십시오.
V형 반전 지표를 기반으로 한 SMA 전략은 VI+ 및 VI- 지표를 계산하여 트렌드 상태를 결합하여 매매 시기를 판단하는 신뢰할 수있는 트렌드 추적 전략입니다. 이 전략의 장점은 신호 품질이 좋고 잡음을 효과적으로 필터링 할 수 있다는 것입니다. 그러나 포용 위험이 있으며 시장 변화에 적응하기 위해 지속적으로 최적화해야합니다.
/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
//@author=SIDD
//Sidd-Vortex strategy is using Vortex formula to generate 4 signals Bullish1 Bullish2 and Bearish1 Bearish2.
//Bullish1 signal is getting generated when smooth ma of VIP is crossing over smooth ma of VIM and smooth VIM is falling from previous bar smooth VIM
//Bullish2 signal is getting generated when smooth ma of VIP is crossing over smooth ma of VIM and smooth VIP is rising from previous bar smooth VIP
//Bearish1 signal is getting generated when smooth ma of VIM is crossing over smooth ma of VIP and smooth VIP is falling from previous bar smooth VIP
//Bearish2 signal is getting generated when smooth ma of VIM is crossing over smooth ma of VIP and smooth VIM is rising from previous bar smooth VIM
//This strategy can be converted into study un-commenting the plotshape and 15th line strategy replace with study and overlay=false
strategy(title = "SIDD-Vortex", shorttitle="SIDD-VORTEX", format=format.price, precision=4,overlay=true)
period_ = input(14, title="Period", minval=2)
len = input(14, minval=1, title="WMA Length")
VMP = sum( abs( high - low[1]), period_ ) // sum of absolute current high and previous low with 14 period default
VMM = sum( abs( low - high[1]), period_ ) // sum of absolute current low and previous high with 14 period default
STR = sum( atr(1), period_ ) //sum of daily atr for 14 days
VIP = VMP / STR
VIM = VMM / STR
simpleMAVIP=wma(VIP, len)
smmaVIP = 0.0
smmaVIP := na(smmaVIP[1]) ? simpleMAVIP : (smmaVIP[1] * (len - 1) + VIP) / len // finding the Smoothing average
simpleMAVIM=wma(VIM, len)
smmaVIM = 0.0
smmaVIM := na(smmaVIM[1]) ? simpleMAVIM : (smmaVIM[1] * (len - 1) + VIM) / len // finding the Smoothing average
risingVIP = rising(smmaVIP, 1)
fallingVIP = falling(smmaVIP, 1)
lineColorVIP = smmaVIP > 0.95 and risingVIP ? color.lime : smmaVIP > 0.95 ? #d65240 : smmaVIP < 0.95 and fallingVIP ? color.red : color.olive
risingVIM = rising(VIM, 1)
fallingVIM = falling(VIM, 1)
lineColorVIM = smmaVIM > 0.95 and risingVIM ? color.red : smmaVIM > 0.95 ? color.olive : smmaVIM < 0.95 and fallingVIM ? color.lime : #d65240
plot(VIP, title="VI +", color=lineColorVIP)
plot(VIM, title="VI -", color=lineColorVIM)
longCondition = crossover(smmaVIP,smmaVIM)
shortCondition = crossover(smmaVIM,smmaVIP)
if (longCondition and fallingVIM)
strategy.entry("Bullish1", strategy.long)
if (shortCondition and fallingVIP)
strategy.entry("Bearish1", strategy.short)
if (longCondition and risingVIP)
strategy.entry("Bullish2", strategy.long)
if (shortCondition and risingVIM)
strategy.entry("Bearish2", strategy.short)
//plotshape(longCondition and fallingVIM, color=color.lime, location=location.belowbar, style=shape.triangleup,size= size.large,text="Bullish",offset=0,textcolor=color.white)
//plotshape(longCondition and risingVIP, color=color.lime, location=location.belowbar, style=shape.labelup,size= size.large,text="Bullish",offset=0,textcolor=color.white)
//plotshape(Diff > 0 and direction>0, color=color.lime, location=location.belowbar, style=shape.arrowup,size= size.normal,offset=0)
//plotshape(shortCondition and fallingVIP , color=color.red, location=location.abovebar, style=shape.triangledown, size= size.large,text="Bearish",offset=0,textcolor=color.white)
//plotshape( shortCondition and risingVIM , color=color.red, location=location.abovebar, style=shape.labeldown, size= size.large,text="Bearish",offset=0,textcolor=color.white)
//band1 = hline(1.0 , title="Upper Line", linestyle=hline.style_dashed, linewidth=3, color=color.red)
//band0 = hline(0.5, title="Lower Line", linestyle=hline.style_dashed, linewidth=3, color=color.lime)
//fill(band1, band0, color=color.purple, transp=70)