
この戦略は,取引量の変化を計算し,市場のトレンドの方向を判断し,トレンド追跡方法を採用し,トレンドの開始段階でポジションを確立し,トレンドの終了時に平仓を停止する.
均線システム,波動率指数などの入場と停止を最適化するために; 誤導信号を防ぐために,量値関係を分析するより多くのデータソースと組み合わせて; 短期的な調整への反応を高めるために適切な技術指標の追加を検討することができます.
入場条件を最適化すると,平均線,ジャセオ極点などの判断を加えることを考え,トレンド開始後に入場を決定する.
ストップを最適化する方法,移動ストップ,レベルストップなどを設定して,ストップを価格に近くしてトレンドをストップする.
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")