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

作者: リン・ハーンチャオチャン, 日付: 2023-12-01 18:13:21
タグ:

img

概要

モメントムダブルムービング平均取引戦略は,価格のモメントムとトレンドインジケーターの両方を利用する短期間の取引戦略である.この戦略は,閉値,開値,価格チャネル,急速なRSIおよびその他のインジケーターを使用して取引信号を生成する.価格ブレイクまたはインジケーター信号が発生するときに長または短ポジションを確立する.また,損失が一定のレベルに達すると清算を強制するためにストップ損失条件を設定する.

戦略原則

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

  1. 価格チャネル:チャネル範囲を決定するために,過去30のキャンドルスタイルの最高値と最低値を計算します.チャネルの中央点以上の閉値は上昇値とみなされます.チャネル中央点以下の閉値は下落値とみなされます.

  2. Fast RSI: 最新の2本のキャンドルストイックのRSI値を計算します. 25未満のRSIは過売れ,75を超えるRSIは過買いとみなされます.

  3. 陰陽線:最新の2本のキャンドルスタイルのエンティティサイズを計算します. 2つの赤いキャンドルは下落信号を示し,2つの緑色のキャンドルは上昇信号を示します.

  4. 損失を停止する条件:損失を制限するために損失が一定パーセントに達すると強制的な清算.

この短期戦略は,トレンド,モメンタム,オーバーバイト/オーバーセールドの指標からの組み合わせのシグナルにより,逆転を効果的に特定し,タイムリーな取引シグナルを生成することができます.

利点分析

この戦略の利点は以下の通りです.

  1. 複数の指標を組み合わせることで 信号の精度が向上し 誤った信号をフィルタリングするのに役立ちます

  2. ターニングポイントに対する迅速な対応は,通常のRSIよりも敏感なFast 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()

もっと