
이 전략은 TEMA, VWMACD, HMA의 세 가지 지표를 사용하여 비트코인의 하락세를 포착합니다. 그것의 주요 논리는 VWMACD 아래 0 축을 통과하면 HMA 평균보다 낮은 가격과 빠른 TEMA가 느린 TEMA보다 낮은 가격으로 공백합니다. VWMACD 위 0 축을 통과하면 HMA 평균보다 높은 가격이나 빠른 TEMA 위 느린 TEMA를 통과하면 평점입니다.
먼저 VWMACD를 계산하고, 기둥 모양의 그래프를 그립니다. 그리고 HMA를 트렌드 필터로 추가합니다. 그 다음, 빠른 라인 TEMA를 만들고, 느린 라인을 추가합니다.
구체적인 입시 규칙은: VWMACD가 0축보다 낮고, 가격이 HMA 평균선보다 낮고, 패스트 라인 TEMA가 슬로 라인 TEMA보다 낮을 때 공백을 다.
구체적인 출전 규칙은: VWMACD에서 0축을 통과할 때, 가격이 HMA 평균선이나 빠른 선 TEMA에서 느린 선 TEMA를 통과할 때 평점.
이 전략은 VWMACD, HMA 및 빠른 속도 TEMA의 조합을 사용하며, Ziel는 비트코인의 단기 하락 트렌드를 포착합니다. 그것의 장점은 신호가 신뢰할 수 있고, 고 주파수 거래에 적합합니다. 그러나 또한 변수 조정 복잡성이 있으며, 노이즈 방해에 취약합니다. 변수 조합을 계속 최적화하고 보조 지표를 추가함으로써 전략을 더 안정적으로 신뢰할 수 있습니다.
/*backtest
start: 2022-11-08 00:00:00
end: 2023-11-14 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy(title="TEMA_HMA_VWMACD short strategy", shorttitle="Short strategy", overlay=false, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.018, currency='USD')
startP = timestamp(input(2017, "Start Year"), input(12, "Month"), input(17, "Day"), 0, 0)
end = timestamp(9999,1,1,0,0)
_testPeriod() =>
iff(time >= startP and time <= end, true, false)
slow = input(13, "Short period")
fast = input(21, "Long period")
signal = input(5, "Smoothing period")
Fast = ema( volume * close, fast ) / ema( volume, fast )
Slow = ema( volume * close, slow ) / ema( volume, slow )
Macd = Slow - Fast
Signal = ema(Macd, signal)
Hist=Macd-Signal
plot(Hist, color=color.silver, linewidth=1, style=plot.style_histogram)
plot(0, color=color.red)
length = input(400, minval=1, title = "HMA")
hullma = wma(2*wma(close, length/2)-wma(close, length), floor(sqrt(length)))
tema_length_1 = input(5, "Fast moving TEMA")
tema_length_2 = input(8, "Slow moving TEMA")
tema(sec, length)=>
tema1= ema(sec, length)
tema2= ema(tema1, length)
tema3= ema(tema2, length)
tema = 3*tema1-3*tema2+tema3
tema1 = tema(hlc3, tema_length_1)
tema2 = tema(hlc3, tema_length_2)
threshold = 0
tm = tema1 - tema2
plot_fast = plot(tm, color = tm > 0 ? color.green : color.red)
plot(threshold, color=color.purple)
up = crossover(tm, 0)
down = crossunder(tm, 0)
longCondition = (Hist < 0) and hullma > close and (tema1 < tema2) and _testPeriod()
strategy.entry('BUY', strategy.short, when=longCondition)
shortCondition = (Hist > 0) or hullma < close or up
strategy.close('BUY', when=shortCondition)
// Take profit
tp = input(1, type=input.float, title='Take Profit (%)')
sl = input(4, type=input.float, title='Stop Loss (%)')
strategy.exit('XLong', from_entry='BUY', profit=(close * (tp/100) * (1/syminfo.mintick)), loss=(close * (sl/100) * (1/syminfo.mintick)))