モメンタムダブル移動平均取引戦略


作成日: 2023-12-01 18:13:21 最終変更日: 2023-12-01 18:13:21
コピー: 1 クリック数: 568
1
フォロー
1619
フォロワー

モメンタムダブル移動平均取引戦略

概要

動量双均線取引戦略は,価格動力とトレンド指標を同時に利用するショートライン取引戦略である.この戦略は,取引シグナルを生成するために,閉盘価格,開盤価格,価格チャネル,急速RSIなどの複数の指標を総合的に使用する.価格突破または指標信号が発生したときに,戦略は長ポジションまたは短ポジションを確立する.さらに,この戦略は,損失が一定幅に達すると,ポジションを平らにする強制的な停止条件も設定している.

戦略原則

この戦略は,主に以下の判断指標に基づいて取引を行います.

  1. 価格チャネル:過去30のKラインの最高価格と最低価格を計算し,チャネル範囲を導き出します.閉店価格がチャネルの中央線より高いときは看板とみなされ,閉店価格がチャネル中央線より低い場合は下落とみなされます.

  2. 急速RSI: 2根K線のRSI値を計算し,RSIが25を下回ると超売りとされ,75以上は超買いとされます.

  3. 陰線判断:最後の2本のK線の実体サイズを計算する。2本の陰線は下落信号,2本の陽線は看板信号とみなす。

  4. ストップ・ロズ条件: 損失が一定比率に達したときにストップ・ロズ・プリーズを強制する.

上述の複数の判断指標に基づいて,戦略は,傾向,動力および超買い超売り状況を同時に把握し,逆転点の取引シグナルを生成することができ,典型的なショートライン取引戦略に属します.

優位分析

この戦略には以下の利点があります.

  1. 複数の指標を用いて判断し,信号の正確性を高めます.単一の指標は偽信号を生成し易く,組み合わせで相互検証し,いくつかのノイズをフィルタリングできます.

  2. 速いRSIはより敏感で,ターニングポイントを間に合うように捕捉できます.通常のRSIは遅滞しやすいため,最適な入場時間を逃します.

  3. 策略パラメータは,複数のテストを経て最適化され,高い安定性を実現した.異なる品種と時間周期で信頼性の高いパフォーマンスを発揮した.

  4. 自動停止メカニズムは損失を制御する. 無限追跡はせず,予想を超える損失を減らすことができる.

リスク分析

この戦略にはいくつかのリスクがあります.

  1. 価格チャネルパラメータの設定が不適切である場合,衝撃を引き起こす可能性があります.チャネル区間の選択が小さすぎると,偽の突破が起こりやすくなります.

  2. 単独のポジション保持時間は長すぎます. 傾向が非常に強くなると,ポジション保持周期は予想よりも長くなります.

  3. ストップポイントの設定が不適切であることも損失を拡大する.このパラメータは慎重に設定し,過大または過小は不利である.

上述のリスクは,通路パラメータの調整,入場タイミングの最適化,ストップポイントの動的調整によって回避および軽減できます.

最適化の方向

この戦略には,以下のいくつかの改善策があります.

  1. 機械学習のアルゴリズムを追加し,パラメータの自動最適化を可能にします. よりスマートで適応性の高い戦略を訓練することができます.

  2. ニュースの情報などのデータソースを組み合わせることで,取引の意思決定が改善され,信号の正確性が向上します.

  3. 市場状況に応じてポジションを自動的に調整するダイナミックなポジション管理メカニズムを開発する.これはリスクを制御する.

  4. 期貨の利回り取引を増やし,戦略の適用範囲を広げます.これはより高い絶対利益を得ることができます.

要約する

この戦略は,価格突破,指数信号,ストップ・レジアウトなど,複数の技術手段を総合的に使用している.反測と实盘の過程において,どちらも良好なパフォーマンスを発揮し,高い安定性を有している.アルゴリズムとデータ技術の発展とともに,戦略のスペースは広大であり,継続的な最適化と改善に値する.

ストラテジーソースコード
/*backtest
start: 2023-11-23 00:00:00
end: 2023-11-30 00:00:00
period: 30m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//Noro
//2018

//@version=2
strategy(title = "Noro's Price Channel Strategy v1.2", shorttitle = "Price Channel str 1.2", overlay=true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, pyramiding = 0)

//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
capital = input(100, defval = 100, minval = 1, maxval = 100000, title = "capital, %")
uset = input(true, defval = true, title = "Use trend entry")
usect = input(true, defval = true, title = "Use counter-trend entry")
usersi = input(true, defval = true, title = "Use RSI strategy")
pch = input(30, defval = 30, minval = 2, maxval = 200, title = "Price Channel Period")
showcl = input(true, defval = true, title = "Price Channel")
fromyear = input(2018, defval = 2018, minval = 1900, maxval = 2100, title = "From Year")
toyear = input(2100, defval = 2100, minval = 1900, maxval = 2100, title = "To Year")
frommonth = input(01, defval = 01, minval = 01, maxval = 12, title = "From Month")
tomonth = input(12, defval = 12, minval = 01, maxval = 12, title = "To Month")
fromday = input(01, defval = 01, minval = 01, maxval = 31, title = "From day")
today = input(31, defval = 31, minval = 01, maxval = 31, title = "To day")
src = close

//Price channel
lasthigh = highest(src, pch)
lastlow = lowest(src, pch)
center = (lasthigh + lastlow) / 2
trend = low > center ? 1 : high < center ? -1 : trend[1]
col = showcl ? blue : na
col2 = showcl ? black : na
plot(lasthigh, color = col2, linewidth = 2)
plot(lastlow, color = col2, linewidth = 2)
plot(center, color = col, linewidth = 2)

//Bars
bar = close > open ? 1 : close < open ? -1 : 0
rbars = sma(bar, 2) == -1
gbars = sma(bar, 2) == 1

//Fast RSI
fastup = rma(max(change(src), 0), 2)
fastdown = rma(-min(change(src), 0), 2)
fastrsi = fastdown == 0 ? 100 : fastup == 0 ? 0 : 100 - (100 / (1 + fastup / fastdown))

//Signals
body = abs(close - open)
abody = sma(body, 10)
up1 = rbars and close > center and uset
dn1 = gbars and close < center and uset
up2 = close <= lastlow and close < open and usect
dn2 = close >= lasthigh and close > open and usect
up3 = fastrsi < 25 and close > center and usersi
dn3 = fastrsi > 75 and close < center and usersi
exit = (((strategy.position_size > 0 and close > open) or (strategy.position_size < 0 and close < open)) and body > abody / 2)
lot = strategy.position_size == 0 ? strategy.equity / close * capital / 100 : lot[1]

//Trading
if up1 or up2 or up3
    if strategy.position_size < 0
        strategy.close_all()
        
    strategy.entry("Long", strategy.long, needlong == false ? 0 : lot, when=(time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)))

if dn1 or dn2 or dn3
    if strategy.position_size > 0
        strategy.close_all()
        
    strategy.entry("Short", strategy.short, needshort == false ? 0 : lot, when=(time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)))
    
if time > timestamp(toyear, tomonth, today, 23, 59) or exit
    strategy.close_all()