
이 전략은 Wavetrend 지표에 기반하여, 여러 개의 오버셀과 오버빌 레벨을 설정하여, 가격이 이 레벨을 만질 때 여러 개의 포지션을 설정하고, 가격이 오버셀 레벨로 반발할 때 평점으로 이익을 얻습니다. 이것은 시장의 오버폴 반발 상황을 포착하기 위한 격자 거래 전략으로, 비트코인과 솔라나와 같은 디지털 화폐의 15 분 주기에는 적용됩니다.
Wavetrend 대량 지표 오버패스 반발망 거래 전략은 오버 판매 오버 구매 신호에 기반한 정량화 전략으로, 분기적으로 포지션을 구축하고 자동 스톱을 하는 방식으로, 오버 패스 후 반발 상황을 포착하여 격차 가격 수익을 얻는다. 이 전략의 장점은 적응력이 강하고, 변수를 유연하게 조정할 수 있지만, 시장의 지속적인 하락, 변수 설정 부적절 등의 위험도 존재한다. 실제 응용에서는 트렌드 필터링, 다이내믹 포지션 및 스톱 스톱 등의 손실 최적화 방법을 추가하여 전략의 안정성과 수익성을 향상시킬 수 있습니다. 그러나 여전히 주의가 필요합니다. 이 전략은 고위험 전략이며, 엄격한 포지션 제어가 필요하며 신중하게 사용해야합니다.
/*backtest
start: 2024-03-25 00:00:00
end: 2024-04-24 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
// © And Isaac, all rights reserved. If there is any piracy, please call the police immediately.
strategy(title='wavetrend',shorttitle='DCA-High win rate quantitative trading')
n1 = input(40,'channel length')
n2 = input(60,'average length')
Oblevel1 = input(40,'over bought level 1')
Oblevel2 = input(50,'over bought level 1')
Oblevel3 = input(70,'over bought level 1')
Oblevel4 = input(80,'over bought level 1')
Oblevel5 = input(100,'over bought level 2')
oslevel1 = input(-40,'over sold level 1')
oslevel2 = input(-45,'over sold level 1')
oslevel3 = input(-50,'over sold level 1')
oslevel4 = input(-55,'over sold level 1')
oslevel5 = input(-65,'over sold level 1')
oslevel6 = input(-75,'over sold level 1')
oslevel7 = input(-85,'over sold level 1')
oslevel8 = input(-100,'over sold level 2')
ap = input(title="source",defval=hlc3)
esa =ta.ema(ap, n1)
d =ta.ema(math.abs(ap - esa),n1)
ci = (ap - esa)/ (0.015 * d)
tci = ta.ema(ci,n2)
wt1 = tci
wt2 = ta.sma(wt1, 4)
plot(0,color=color.new(#787b86, 0 ))
plot(Oblevel1, color=color.new(#89ff52, 53), linewidth = 2)
plot(oslevel1, color=color.new(#89ff52, 53), linewidth = 2)
plot(oslevel2, color=color.new(#89ff52, 53), linewidth = 2)
plot(oslevel3, color=color.new(#89ff52, 53), linewidth = 2)
plot(oslevel4, color=color.new(#89ff52, 53), linewidth = 2)
plot(oslevel5, color=color.new(#89ff52, 53), linewidth = 2)
plot(oslevel6, color=color.new(#89ff52, 53), linewidth = 2)
plot(oslevel7, color=color.new(#89ff52, 53), linewidth = 2)
plot(oslevel8, color=color.new(#89ff52, 53), linewidth = 2)
plot(oslevel2, color=color.new(#89ff52, 53), linewidth = 2)
plot(wt1, color=color.new(#ff5252,0))
plot(wt2, color=color.new(#ffffff,0))
plot(wt1 - wt2, color=color.new(#00bcd4, 30),style=plot.style_area)
plot(ta.cross(wt1, wt2) ? wt2 : na, color=color.new(#ff5252,0) , style=plot.style_circles, linewidth=4 )
// barcolor(cross(wt1, wt2) ? (wt2 - wt1 > 0 ? aqua : yellow) : na)
barcolor(ta.cross(wt1, wt2) ? (wt2 - wt1 > 0 ? color.new(#ffffff,0) : color.new(#89ff52, 53)) : na)
/////////////
Long1 = wt2 < oslevel1 and wt1 < oslevel1 and wt1>wt2 and wt2 > oslevel3 and wt1>oslevel3
Long5 = wt2 < oslevel5 and wt1 < oslevel5 and wt1>wt2 and wt2 > oslevel6 and wt1>oslevel6
Long7 = wt2 < oslevel7 and wt1 < oslevel7 and wt1>wt2 and wt2 > oslevel8 and wt1>oslevel8
Long8 = wt2 < oslevel8 and wt1 < oslevel8 and wt1>wt2
LS1 = wt2 > Oblevel1 and wt1 > Oblevel1 and wt1<wt2
if Long1
strategy.entry("L",strategy.long,comment = "做多1")
if Long5
strategy.entry("L",strategy.long,comment = "做5")
if Long7
strategy.entry("L",strategy.long,comment = "做多7")
if Long8
strategy.entry("L",strategy.long,comment = "做多8")
if LS1
strategy.close("L", qty_percent = 70,comment = "平多")