이 전략은 거래량 변화를 계산하여 시장의 경향 방향을 판단하고, 트렌드 추적 방식을 채택하여, 트렌드 초기 단계에서 포지션을 구축하고, 트렌드 종료 시에는 포지션을 중지한다.
진입과 상쇄를 최적화하기 위해 평선 시스템, 변동률 지표 등을 추가하는 것을 고려할 수 있습니다. 더 많은 데이터 소스 분석량 가격 관계를 결합하여 잘못된 신호를 방지합니다. 적절한 기술 지표가 추가되어 단기 조정에 대한 응답이 향상됩니다.
진입 조건을 최적화하여, 평균선, 자세오극점 등의 판단을 포함할 수 있으며, 트렌드 시작 후 진입을 결정한다.
최적화된 스톱 방식, 이동 스톱, 레벨 스톱 등을 설정하여 스톱을 가격에 더 가깝게 하고 트렌드를 추적하는 스톱을 설정할 수 있다.
ADX와 같은 트렌드 판단 요소를 추가하면横盘 및 흔들리는 시장의 잘못된 거래를 피할 수 있습니다.
최적화 파라미터 설정을 통해 더 긴 데이터 회귀를 통해 최적의 파라미터 조합을 찾을 수 있다.
더 많은 품종으로 전략을 확장하고 더 나은 품질과 거래량이 더 활발한 품종을 찾습니다.
더 많은 데이터를 사용하여 양-가치 관계를 판단하고 신호 품질을 향상시키는 기계 학습 모델을 고려하십시오.
이 전략의 전체적인 아이디어는 명확하고, 핵심 지표는 직관적으로 이해하기 쉽고, 트렌드 방향을 신뢰할 수 있게 식별한다. 전략의 장점은 거래량 변화를 강조하는 데 있으며, 중장선 트렌드를 추적하는 데 적합하지만, 잘못된 신호를 방지해야합니다. 매개 변수 최적화, 손해 중지 방식 개선, 지표 최적화 조합 등을 통해 개선하면 전략의 실장 성능을 더욱 향상시킬 수 있다.
/*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("Strategy for Volume Flow Indicator with alerts and markers on the chart", overlay=true)
// This indicator has been copied form Lazy Bear's code
lengthVFI = 130
coefVFI = 0.2
vcoefVFI = 2.5
signalLength= 5
smoothVFI=true
ma(x,y) => smoothVFI ? sma(x,y) : x
typical=hlc3
inter = log( typical ) - log( typical[1] )
vinter = stdev(inter, 30 )
cutoff = coefVFI * vinter * close
vave = sma( volume, lengthVFI )[1]
vmax = vave * vcoefVFI
vc = iff(volume < vmax, volume, vmax)
mf = typical - typical[1]
vcp = iff( mf > cutoff, vc, iff ( mf < -cutoff, -vc, 0 ) )
vfi = ma(sum( vcp , lengthVFI )/vave, 3)
vfima=ema( vfi, signalLength )
dVFI=vfi-vfima
bullishVFI = dVFI > 0 and dVFI[1] <=0
bearishVFI = dVFI < 0 and dVFI[1] >=0
longCondition = dVFI > 0 and dVFI[1] <=0
shortCondition = dVFI < 0 and dVFI[1] >=0
plotshape(bullishVFI, color=color.green, style=shape.labelup, textcolor=#000000, text="VFI", location=location.belowbar, transp=0)
plotshape(bearishVFI, color=color.red, style=shape.labeldown, textcolor=#ffffff, text="VFI", location=location.abovebar, transp=0)
alertcondition(bullishVFI, title='Bullish - Volume Flow Indicator', message='Bullish - Volume Flow Indicator')
alertcondition(bearishVFI, title='Bearish - Volume Flow Indicator', message='Bearish - Volume Flow Indicator')
if(year > 2018)
strategy.entry("Long", strategy.long, when=dVFI > 0 and dVFI[1] <=0)
if(shortCondition)
strategy.close(id="Long")