カロベイン平均逆転によるスケール標準化ベクトル戦略

作者: リン・ハーンチャオチャン,日付: 2023年11月3日 16:56:13
タグ:

img

概要

この戦略は,Karobein Mean Reversion インディケーターと価格動向に基づいています.トレンド判断のために価格動向補助指標を使用し,特定のエントリのためにKarobein Mean Reversion インディケーターを組み合わせます.この戦略は中期および長期取引に適しています.

戦略原則

まず,戦略は,価格動向指標を得るために,異なる期間の価格変動率を計算します.価格動向指標が動向的な値線を超えると,長い信号が生成されます.下を通ると,ショート信号が生成されます.

カロベイン平均逆転指標は,価格変動の加速と経路を反映できる価格の平均逆転性質に基づいて計算される.この指標は,トレンドの方向性とタイミングを決定するのに役立つ内在的なシナウソイド特性を備えています.

価格動向指標が信号を生成すると,Karobein Mean Reverssion指標が対応する方向領域にある場合,エントリー信号が生成されます.

利点

  1. 戦略は,価格動向と平均逆転因子を包括的に考慮し,強い傾向判断能力を有します.

  2. カロベイン平均逆転指標は 価格の転換点を正確に特定し,エントリータイミングの精度を向上させることができます

  3. 保持期間をパラメータ調整によって自由に制御できるので,異なる時間枠に適しています.

  4. 市場変化に適応するための ダイナミックスロージルはリアルタイムで調整できます.

リスク

  1. 傾向を追求する戦略として 範囲限定のトレンドに 囚われやすいのです

  2. カロベイン平均逆転指標は 値転換点を見逃す可能性があります

  3. 過剰な保有期間による損失の拡大を避けるため,保持期間パラメータを監視すべきである.

  4. ダイナミック・ドレッホは 適正に設定されすぎないべきです そうでなければ 参入機会を逃す可能性があります

対応するリスク管理方法

  1. トレンド判断指標は,市場変動と出口ポジションをタイムリーに予測するために使用できます.

  2. 遅延を減らすため,Karobein 平均逆転指標の合理的な遅延を選択します.

  3. 異なる保持期間パラメータをテストし,適切なパラメータを選択します.

  4. ダイナミックスロージムの範囲を調整して,出ていないエントリを避ける.

改善の方向性

  1. パラメータを最適化するために,価格の動向を計算するための異なる期間をテストします.

  2. 変動指標を追加して 市場を検出し ストップロスを設定します

  3. カロベイン平均逆転指標のパラメータを最適化し,より敏感にする.

  4. 信号の質を改善するために音量などの追加フィルターを追加します

  5. マシン学習アルゴリズムを使って パーマータを動的に最適化します

結論

この戦略は,トレンド判断とシグナル生成の強力な能力を持つ,価格勢力と平均逆転因子を包括的に利用する.パラメータチューニングを通じて異なる市場環境に適応することができる.戦略をより堅牢にするためにエントリータイミングとストップ損失に関するさらなる最適化が行うことができる.この戦略はさらなる研究と適用に値する.


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

//@version=4
// author: capissimo
strategy("Normalized Vector Strategy, ver.3 (sc)", precision=2, overlay=false)
// This is a scaled Normalized Vector Strategy with a Karobein Oscillator
// original: Drkhodakarami (https://www.tradingview.com/script/Fxv2xFWe-Normalized-Vector-Strategy-By-Drkhodakarami-Opensource/)

// Repainting: in general there two types of repainting:
// * when the last candle is constantly being redrawn
// * when the indicator draws a different configuration after it has been deactivated/reactivated, i.e. refreshed

// The former is a natural behaviour, which presents a constant source of frustration, 
// when a signal directly depends on the current market situation and can be overcome 
// with various indirect techniques like divergence.

// The latter suggests a flaw in the indicator design.
// Unfortunately, the Normalized Vector Strategy is repainting in the latter sense, although being
// really promising. Would be nice if our community suggests a solution to this problem ))

// This strat consistently performs with high accuracy, showing up to 96% scores
// Here are some of the best parameters:
// TF     Lookback   Performance (ca.)
// 1m     13         92%
// 3m     34         92%
// 5m     85         92%
// 15m    210        90%
// 30m    360        89%
// 1H     1440,720   94%, 87%

// The Karobein Oscillator has an intrinsic sinusoidal behaviour that helps in determining direction and timing.
// It does not repaint.
// original: alexgrover (https://www.tradingview.com/script/JiNi0f62-Karobein-Oscillator/)

scaleMinimax(X, p, min, max) => 
    hi = highest(X, p), lo = lowest(X, p)
    (max - min) * (X - lo)/(hi - lo) + min

price    = input(close,  "Price Data")
tf       = input(34,     "Timeframe", minval=1, maxval=1440)
thresh   = input(14.,    "Threshold", minval=.1, step=.1) 
div      = input(1000000,"Divisor", options=[1,10,100,1000,10000,100000,1000000,10000000,100000000])
showVol  = input(false,  "Volume")
useold   = input(true,   "Use Old System")

lime  = color.new(color.lime, 10), fuchsia = color.new(color.fuchsia, 10), 
black = color.new(color.black, 100), gray = color.new(color.gray, 50)

vol  = useold ? security(syminfo.tickerid, tostring(tf), volume, barmerge.gaps_off, barmerge.lookahead_on) 
              : security(syminfo.tickerid, tostring(tf), volume)
obv  = cum(change(price) > 0 ? vol : change(price) < 0 ? -vol : 0*vol)
prix = showVol ? obv : price
    
getdiff(prc, tf) =>
    prev  = useold ? security(syminfo.tickerid, tostring(tf), prc[1], barmerge.gaps_off, barmerge.lookahead_on) :
                     security(syminfo.tickerid, tostring(tf), prc[1])
    curr  = useold ? security(syminfo.tickerid, tostring(tf), prc, barmerge.gaps_off, barmerge.lookahead_on) : 
                     security(syminfo.tickerid, tostring(tf), prc)
    (curr/prev) - 1
    
p  = getdiff(prix, tf)
up = thresh/div, dn = -thresh/div
longCondition  = crossover(p, up)
shortCondition = crossunder(p, dn)

bg = longCondition ? lime : shortCondition ? fuchsia : black
cl = p > up ? color.green : p < dn ? color.red : color.silver

bgcolor(bg, editable=false)
plot(scaleMinimax(up, 2500, -1, 1), color=lime, editable=false, transp=0)
hline(0, linestyle=hline.style_dotted, title="base line", color=gray, editable=false)
plot(scaleMinimax(dn, 2500, -1, 1), color=fuchsia, editable=false, transp=0)
plot(scaleMinimax(p, 2500, -1, 1), color=cl, style=plot.style_histogram, transp=70, editable=false)
plot(scaleMinimax(p, 2500, -1, 1), color=cl, style=plot.style_linebr, title="prediction", transp=0, editable=false)

strategy.entry("L", true, 1, when=longCondition)
strategy.entry("S", false, 1, when=shortCondition)

alertcondition(longCondition, title='Long', message='Long Signal!')
alertcondition(shortCondition, title='Short', message='Short Signal!')

//*** Karobein Oscillator
per  = input(8, "Karobein Osc Lookback")

prix2  = ema(price, per)
a = ema(prix2 < prix2[1] ? prix2/prix2[1] : 0, per)
b = ema(prix2 > prix2[1] ? prix2/prix2[1] : 0, per)
c = (prix2/prix2[1])/(prix2/prix2[1] + b)
d = 2*((prix2/prix2[1])/(prix2/prix2[1] + c*a)) - 1

plot(scaleMinimax(d, 2500, -1, 1), color=color.orange, transp=0)


もっと