V-リバース SMA 戦略

作者: リン・ハーンチャオチャン,日付: 2024-02-18 15時04分34秒
タグ:

img

概要

V-リバース SMA戦略は,前日の最低価格と最高価格との間の14日絶対差と,前日の最高価格と最低価格との間の14日絶対差を計算する.その後,VI+とVI-曲線を形成するために14日間の単純な移動平均を計算する.VI+がVIを超えると購入信号が生成される.VI+がVI+を下回ると販売信号が生成される.

原則

この戦略のコア指標はVI+とVI−である.VI+は上昇勢いを反映し,VI-は下落勢いを反映する.具体的な計算式は以下のとおりである.

VMP = SUM(ABS(HIGH - LOW[1]),14)  
VMM = SUM(ABS(LOW - HIGH[1]),14)
STR = SUM(ATR(1),14)
VI+ = VMP/STR
VI- = VMM/STR

曲線における振動を除去するために,VI+とVI-で14日間の単純な移動平均を計算し,SMA ((VI+) とSMA ((VI-) を得ます.SMA ((VI+) がSMA (VI-) を越えると上昇信号が生成されます.SMA ((VI-) がSMA (VI-) を越えると下落信号が生成されます.

さらに,戦略は,傾向を判断し,信号をフィルタリングするためにVI+とVI-の上昇と減少状態を組み合わせ,傾向が低下するときにのみロングで,傾向が上昇するときにのみショートになります.

利点分析

この戦略は,トレンドステータスとVI指標のゴールデン/デッドクロスを組み合わせることで,誤った信号を効果的にフィルタリングし,収益性を向上させることができます.単純な移動平均戦略と比較して,ブレイクアウト信号はより信頼性があります.

リスク分析

この戦略の主なリスクは,

  1. VI インディケーターは,特定の期間に誤った信号を生む可能性があります.リスク制御のために,トレンドフィルタリングとストップロスを使用する必要があります.

  2. 高い取引コストやスリップが伴う市場は この戦略には適さない.これは利益率を大幅に低下させる.

オプティマイゼーションの方向性

戦略は以下の側面で最適化できます.

  1. VI指標のパラメータを最適化し,最適なパラメータ組み合わせを見つけます.

  2. 機械学習方法を用いて 誤った信号を自動的に識別し 信号の質を向上させる

  3. ストップ損失とマネーマネジメントによる退出メカニズムを最適化し,単一の取引損失を制御する.

  4. 低コストの市場に焦点を当てて,取引製品の選択を最適化する.

結論

V-リバース SMA戦略は,VI+およびVI-指標を計算し,トレンド状態を組み合わせて取引信号を決定する.これは比較的信頼性の高いトレンドフォロー戦略である.その強みは高い信号品質とノイズをフィルタリングする能力にある.しかし,市場変化に適応するために継続的な最適化を必要とする罠に陥るリスクもあります.


/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
//@author=SIDD
//Sidd-Vortex strategy is using Vortex formula  to generate 4 signals Bullish1 Bullish2 and Bearish1 Bearish2.

//Bullish1 signal is getting generated when smooth ma of VIP is crossing over smooth ma of VIM and smooth VIM is falling from previous bar smooth VIM

//Bullish2 signal is getting generated when smooth ma of VIP is crossing over smooth ma of VIM and smooth VIP is rising from previous bar smooth VIP

//Bearish1 signal is getting generated when smooth ma of VIM is crossing over smooth ma of VIP and smooth VIP is falling from previous bar smooth VIP

//Bearish2 signal is getting generated when smooth ma of VIM is crossing over smooth ma of VIP and smooth VIM is rising from previous bar smooth VIM

//This strategy can be converted into study un-commenting the plotshape and 15th line strategy replace with study and overlay=false

strategy(title = "SIDD-Vortex", shorttitle="SIDD-VORTEX", format=format.price, precision=4,overlay=true)
period_ = input(14, title="Period", minval=2)
len = input(14, minval=1, title="WMA Length")

VMP = sum( abs( high - low[1]), period_ ) // sum of absolute current high and previous low with 14 period default
VMM = sum( abs( low - high[1]), period_ ) // sum of absolute current low and previous high with 14 period default
STR = sum( atr(1), period_ )  //sum of daily atr for 14 days
VIP = VMP / STR
VIM = VMM / STR

simpleMAVIP=wma(VIP, len) 
smmaVIP = 0.0
smmaVIP := na(smmaVIP[1]) ? simpleMAVIP : (smmaVIP[1] * (len - 1) + VIP) / len // finding the Smoothing average 

simpleMAVIM=wma(VIM, len) 
smmaVIM = 0.0
smmaVIM := na(smmaVIM[1]) ? simpleMAVIM : (smmaVIM[1] * (len - 1) + VIM) / len // finding the Smoothing average 


risingVIP = rising(smmaVIP, 1)
fallingVIP = falling(smmaVIP, 1)

lineColorVIP = smmaVIP > 0.95 and risingVIP  ? color.lime : smmaVIP > 0.95 ? #d65240 : smmaVIP < 0.95 and fallingVIP ? color.red : color.olive

risingVIM = rising(VIM, 1)
fallingVIM = falling(VIM, 1)

lineColorVIM = smmaVIM > 0.95 and risingVIM  ? color.red : smmaVIM > 0.95 ? color.olive : smmaVIM < 0.95 and fallingVIM ? color.lime : #d65240

plot(VIP, title="VI +", color=lineColorVIP)
plot(VIM, title="VI -", color=lineColorVIM) 

longCondition = crossover(smmaVIP,smmaVIM)
shortCondition = crossover(smmaVIM,smmaVIP)


if (longCondition and fallingVIM)
    strategy.entry("Bullish1", strategy.long)
if (shortCondition and fallingVIP)
    strategy.entry("Bearish1", strategy.short)

if (longCondition and risingVIP)
    strategy.entry("Bullish2", strategy.long)
if (shortCondition and risingVIM)
    strategy.entry("Bearish2", strategy.short)
    
//plotshape(longCondition and fallingVIM, color=color.lime, location=location.belowbar, style=shape.triangleup,size= size.large,text="Bullish",offset=0,textcolor=color.white)
//plotshape(longCondition and risingVIP, color=color.lime, location=location.belowbar, style=shape.labelup,size= size.large,text="Bullish",offset=0,textcolor=color.white)
//plotshape(Diff > 0 and direction>0, color=color.lime, location=location.belowbar, style=shape.arrowup,size= size.normal,offset=0)
    
//plotshape(shortCondition and fallingVIP  , color=color.red, location=location.abovebar, style=shape.triangledown, size= size.large,text="Bearish",offset=0,textcolor=color.white)
//plotshape( shortCondition and risingVIM  , color=color.red, location=location.abovebar, style=shape.labeldown, size= size.large,text="Bearish",offset=0,textcolor=color.white)



//band1 = hline(1.0  , title="Upper Line", linestyle=hline.style_dashed, linewidth=3, color=color.red)
//band0 = hline(0.5, title="Lower Line", linestyle=hline.style_dashed, linewidth=3, color=color.lime)
//fill(band1, band0, color=color.purple, transp=70)




もっと