スマートマネー指数 (SMI) 戦略バックテスト

作者: リン・ハーンチャオチャン,日付: 2023-09-21 21:14:02
タグ:

概要

SMIは,Smart Money Index (SMI) をベースとした定量的な取引戦略である.この指数は,機関ファンドの活動を反映し,SMIの動きを分析することによって潜在的な市場動向を予測するために使用される.投資家の感情分析に基づく取引戦略に属している.

戦略の論理

スマートマネー指数 (SMI) が主な指標である.その計算式は:

SMI = SMA (今日の閉店 - 今日の開店 + 昨日の閉店 - 昨日の開店,N)

Nはパラメータ周期です

SMIはスマートマネーの流入と流出を反映する.SMIの上昇は,スマートマネーの純流入を示し,スマートマネーの上昇を示します.SMIの低下は,スマートマネーの純流出を示し,スマートマネーの下落を示します.

SMIが上昇するとロングで SMIが落ちるとショートで スマートマネーの動きを追います

利点

  • スマートマネーの活動を記録する
  • シンプルなSMI計算,実行が簡単
  • 投資家の感情を反映し,市場の変化に敏感です
  • 製品と時間枠に当てはまる
  • 調整可能なパラメータ

リスク

  • SMI 自身も遅れている可能性があります
  • 単一の指標に依存するウィップソーに傾向がある
  • 牛/熊市場を区別できない,TAが必要
  • 効果的ストップなし 大幅な引き上げ
  • パラメータは製品と時間枠によって最適化する必要があります

リスクは以下によって軽減できます.

  • SMI パラメータ期間を最適化
  • 確認のための技術指標の追加
  • リスク管理のためのストップ損失/利益規則の実施
  • 製品と時間枠に基づくパラメータ調整
  • 位置サイズ調整システム

改善の方向性

戦略は以下によって改善できます.

  1. SMI の 最適な 計算 期間 を 探す

  2. SMI信号に MACD のようなフィルターを追加する

  3. 移動式または固定式停止装置を含む

  4. 製品特有のパラメータの最適化

  5. ヘッジファンドのような異なる時間枠のための理想的な期間を特定する

  6. 市場変動によるポジションサイズ調整

概要

この戦略は,トレンド取引のための市場参加者の感情を反映するために,スマートマネーインデックスを使用する.これは,機関ファンドの動きをタイムリーに把握することができる.しかし,SMIは遅れ,単一の指標に依存することはリスクが高い可能性があります.パラメータ調節,フィルターを追加,ストップを実施,ダイナミックなポジションサイジングを通じて改善することができます.これは戦略をより堅牢にすることができます.


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

//@version=2
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 01/08/2018
// Attention:
// If you would to use this indicator on the ES, you should have intraday data 60min in your account.
//
// Smart money index (SMI) or smart money flow index is a technical analysis indicator demonstrating investors sentiment. 
// The index was invented and popularized by money manager Don Hays.[1] The indicator is based on intra-day price patterns.
// The main idea is that the majority of traders (emotional, news-driven) overreact at the beginning of the trading day 
// because of the overnight news and economic data. There is also a lot of buying on market orders and short covering at the opening. 
// Smart, experienced investors start trading closer to the end of the day having the opportunity to evaluate market performance.
// Therefore, the basic strategy is to bet against the morning price trend and bet with the evening price trend. The SMI may be calculated 
// for many markets and market indices (S&P 500, DJIA, etc.)
//
// The SMI sends no clear signal whether the market is bullish or bearish. There are also no fixed absolute or relative readings signaling 
// about the trend. Traders need to look at the SMI dynamics relative to that of the market. If, for example, SMI rises sharply when the 
// market falls, this fact would mean that smart money is buying, and the market is to revert to an uptrend soon. The opposite situation 
// is also true. A rapidly falling SMI during a bullish market means that smart money is selling and that market is to revert to a downtrend 
// soon. The SMI is, therefore, a trend-based indicator.
// Some analysts use the smart money index to claim that precious metals such as gold will continually maintain value in the future.
//
// You can change long to short in the Input Settings
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
strategy(title="Smart Money Index (SMI) Backtest", shorttitle="Smart Money Index")
Length = input(18, minval=1)
reverse = input(false, title="Trade reverse")
xcloseH1 = security(syminfo.tickerid, "60", close[1])
xopenH1 =  security(syminfo.tickerid, "60", open[1])
nRes = nz(nRes[1], 1) - (open - close) + (xopenH1 - xcloseH1)
xSmaRes = sma(nRes, Length)
pos = iff(xSmaRes > nRes, 1,
       iff(xSmaRes < nRes, -1, nz(pos[1], 0))) 
possig = iff(reverse and pos == 1, -1,
          iff(reverse and pos == -1, 1, pos))	   
if (possig == 1) 
    strategy.entry("Long", strategy.long)
if (possig == -1)
    strategy.entry("Short", strategy.short)	   	    
barcolor(possig == -1 ? red: possig == 1 ? green : blue ) 
plot(xSmaRes, color=red, title="SMASMI")
plot(nRes, color=green, title="SMI")

もっと