アダプティブ・ボラティリティ・有限体積要素戦略

作者: リン・ハーンチャオチャン開催日:2023年10月17日 14:50:13
タグ:

img

概要

この戦略は,トレンドフォローする戦略に属する長短シグナルを決定するために,適応性波動度メトリックと組み合わせた有限体積要素方法を使用する.すべてのタイムフレームに適用され,異なる波動度レベルに適応するためにパラメータを自動的に調整することができます.

原則

この戦略は,まず高値と低値の平均値,最近のNバーの閉値の平均値,そして前のバーの平均高値,低値,閉値を計算する.その後,現在のバーと前のバーの対数値イントラとインターを計算する.一方,イントラとインターのヴィントラとヴィンター波動性を計算する.

波動性レベルと調整可能なパラメータに基づいて,適応性カットオフ係数CutOffが決定される.価格の変化がカットオフを超えると,ロングまたはショートシグナルが生成される.具体的には,現在の閉値と高値と低値の平均との間の差MFを計算する.MFがカットオフよりも大きいとき,それはロングシグナルである.MFがマイナスカットオフよりも小さいとき,それはショートシグナルである.

最後に,シグナルに従って,資金流が計算され,ポジションシグナルposを出力され,有限体積要素曲線FVEをプロットします.

利点

  1. 適応性のあるパラメータは,手動調整なしで異なる時間枠と変動レベルに適用されます.

  2. 価格の傾向の変化を正確に把握します

  3. FVE曲線は,長力と短力の比較を明確に反映しています.

  4. 資金流の分析の理論的な基礎は 比較的信頼できる信号です

リスク

  1. 激しい市場変動の際により多くの誤った信号を生成し Nを調整することができます.

  2. 価格格差を処理できない 他の指標を組み合わせることを検討できる

  3. 資金流れの信号は技術分析と異なる場合もあります.複数の信号を組み合わせることもあります.

最適化

  1. 異なるN値の影響をテストできます 一般的に大きなNはノイズをフィルタリングできます

  2. CintraとCinterの異なる組み合わせをテストして最適なパラメータを見つけるか ダイナミックに適応することを検討します

  3. MACDなどの他の指標と組み合わせて 安定性を向上させることができます

  4. ストップ・ロスのメカニズムを組み込み,単一の取引損失を制御することができます.

結論

この戦略は,固い原則でかなり信頼性があります. 傾向を追跡する戦略の構成要素として機能し,他の戦略と適切に組み合わせるとさらにうまく機能します. 鍵は最適なパラメータを見つけ,健全なリスク管理を確立することです. さらに最適化されれば,非常に強力な傾向を追跡システムになることができます.


/*backtest
start: 2022-10-10 00:00:00
end: 2023-10-16 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 18/08/2017
// This is another version of FVE indicator that we have posted earlier 
// in this forum.
// This version has an important enhancement to the previous one that`s 
// especially useful with intraday minute charts.
// Due to the volatility had not been taken into account to avoid the extra 
// complication in the formula, the previous formula has some drawbacks:
// The main drawback is that the constant cutoff coefficient will overestimate 
// price changes in minute charts and underestimate corresponding changes in 
// weekly or monthly charts.
// And now the indicator uses adaptive cutoff coefficient which will adjust to 
// all time frames automatically.
//
// You can change long to short in the Input Settings
// Please, use it only for learning or paper trading. Do not for real trading.
////////////////////////////////////////////////////////////
strategy(title="Volatility Finite Volume Elements", shorttitle="FVI")
Samples = input(22, minval=1)
Perma = input(40, minval=1)
Cintra = input(0.1, step=0.1)
Cinter = input(0.1, step=0.1)
reverse = input(false, title="Trade reverse")
xhl2 = hl2
xhlc3 = hlc3
xClose = close
xIntra = log(high) - log(low)
xInter = log(xhlc3) - log(xhlc3[1])
xStDevIntra = stdev(sma(xIntra, Samples) , Samples)
xStDevInter = stdev(sma(xInter, Samples) , Samples)
xVolume = volume
TP = xhlc3
TP1 = xhlc3[1]
Intra = xIntra
Vintra = xStDevIntra
Inter = xInter
Vinter = xStDevInter
CutOff = Cintra * Vintra + Cinter * Vinter
MF = xClose - xhl2 + TP - TP1
FveFactor = iff(MF > CutOff * xClose, 1, 
             iff(MF < -1 * CutOff * xClose, -1,  0))
xVolumePlusMinus = xVolume * FveFactor
Fvesum = sum(xVolumePlusMinus, Samples)
VolSum = sum(xVolume, Samples)
xFVE = (Fvesum / VolSum) * 100
xEMAFVE = ema(xFVE, Perma)
pos = iff(xFVE > xEMAFVE, 1,
	   iff(xFVE < xEMAFVE, -1, nz(pos[1], 0))) 
possig = iff(reverse and pos == 1, -1,
          iff(reverse and pos == -1, 1, pos))	   
if (possig == 1) 
    strategy.entry("Long", strategy.long)
if (possig == -1)
    strategy.entry("Short", strategy.short)	   	    
barcolor(possig == -1 ? red: possig == 1 ? green : blue ) 
plot(xFVE, color=green, title="FVI")
plot(xEMAFVE, color=blue, title="FVI EMA")

もっと