定量モデルに基づく高性能アルゴリズム取引戦略

作者: リン・ハーンチャオチャン,日付: 2023年12月22日 13:14:33
タグ:

img

概要

この戦略は,定量モデルに基づく高性能アルゴリズムの取引戦略である. モデリウス・ボリュームモデルを基本モデルとして使用し,さらに拡張し最適化する. この戦略は,市場における定量的な取引機会を把握し,安定した利益を達成することができる.

戦略原則

この戦略の核心はモデリウス・ボリュームモデルである.このモデルは価格とボリュームの変化を検出することによって市場における定量的な取引機会を特定する.具体的には,戦略は,特定のルールに基づいて現在のKラインの方向を計算するために,閉じる価格,開く価格,最高価格,最低価格を組み合わせます.Kラインの方向が変化すると,取引量に基づいて定量的な取引機会の質が判断されます.さらに,戦略は,入口と出口タイミングを決定するのに役立つSAR指標と移動平均指標も組み合わせます.

基本の取引論理は,指標がマイナスからポジティブに突破するとロング,指標がマイナスからポジティブに突破するとショートである.また,ストップ・ロスト,テイク・プロフィート,トライリング・ストップ・ロストはリスクを制御するために設定されています.

利点分析

この戦略の最大の利点は,モデリウス・ボリュームモデルが定量的な取引機会を効果的に特定できる点である.このモデルは,従来の技術指標と比較して,ボリューム変化により注意を払っており,今日の高周波の定量的な取引では非常に実用的である.また,戦略のエントリールールは比較的厳格で,定量的な取引機会を逃すのを効果的に回避し,混乱の確率をできるだけ減らすことができる.

リスク分析

この戦略の主なリスクは,Modelius Volume モデル自体はノイズを完全に回避できないことである.異常な市場変動がある場合,それは間違った取引信号につながります.また,戦略内のパラメータ設定も最終結果に影響します.

リスクを制御するために,パラメータを相応に調整し,補助判断のための他の指標と組み合わせることができます.さらに,ストップ損失と利益を取ることは合理的に設定する必要があります.

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

この戦略の最適化にはまだ余地がある.例えば,機械学習アルゴリズムはパラメータ設定を動的に最適化することを考慮することができる.または,判断の正確性を向上させるために,感情分析やその他の指標を組み合わせることができる.また,さまざまな種類間の相関を研究し,マルチバリエーション仲介モデルを確立することができる.

概要

概要すると,この戦略は,モデリウス・ボリューム定量モデルの利点を利用し,高運用性のあるアルゴリズム的な取引戦略を設計する.パラメータチューニング,モデル拡張,機械学習などを通じてさらに最適化および強化され,実際の取引で比較的良い安定した収益を得ることができます.


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


//@version=3
strategy(title="strategy modelius volume model ", shorttitle="mvm",overlay=true, calc_on_order_fills=true, default_qty_type=strategy.percent_of_equity, default_qty_value=50, overlay=false)

method = input(defval="ATR", options=["ATR", "Traditional", "Part of Price"], title="Renko Assignment Method")
methodvalue = input(defval=14.0, type=float, minval=0, title="Value")
pricesource = input(defval="Close", options=["Close", "Open / Close", "High / Low"], title="Price Source")
useClose = pricesource == "Close"
useOpenClose = pricesource == "Open / Close" or useClose
useTrueRange = input(defval="Auto", options=["Always", "Auto", "Never"], title="Use True Range instead of Volume")
isOscillating=input(defval=true, type=bool, title="Oscillating")
normalize=input(defval=false, type=bool, title="Normalize")
vol = useTrueRange == "Always" or (useTrueRange == "Auto" and na(volume))? tr : volume
op = useClose ? close : open
hi = useOpenClose ? close >= op ? close : op : high
lo = useOpenClose ? close <= op ? close : op : low

if method == "ATR"
    methodvalue := atr(round(methodvalue))
if method == "Part of Price"
    methodvalue := close/methodvalue

currclose = na
prevclose = nz(currclose[1])
prevhigh = prevclose + methodvalue
prevlow = prevclose - methodvalue
currclose := hi > prevhigh ? hi : lo < prevlow ? lo : prevclose

direction = na
direction := currclose > prevclose ? 1 : currclose < prevclose ? -1 : nz(direction[1])
directionHasChanged = change(direction) != 0
directionIsUp = direction > 0
directionIsDown = direction < 0

barcount = 1
barcount := not directionHasChanged and normalize ? barcount[1] + barcount : barcount
vol := not directionHasChanged ? vol[1] + vol : vol
res = barcount > 1 ? vol/barcount : vol


x=isOscillating and directionIsDown ? -res : res

TP = input(0) * 10
SL = input(0) * 10
TS = input(1) * 10
TO = input(3) * 10
CQ = 100

TPP = (TP > 0) ? TP : na
SLP = (SL > 0) ? SL : na
TSP = (TS > 0) ? TS : na
TOP = (TO > 0) ? TO : na

longCondition = crossover(x,0)
if (longCondition)
    strategy.entry("Long", strategy.long)


shortCondition = crossunder(x,0)
if (shortCondition)
    strategy.entry("Short", strategy.short)

strategy.exit("Close Short", "Short", qty_percent=CQ, profit=TPP, loss=SLP, trail_points=TSP, trail_offset=TOP)
strategy.exit("Close Long", "Long", qty_percent=CQ, profit=TPP, loss=SLP, trail_points=TSP, trail_offset=TOP)

もっと