スマートファンドインデックス戦略バックテスト


作成日: 2023-09-21 21:14:02 最終変更日: 2023-09-21 21:14:02
コピー: 0 クリック数: 747
1
フォロー
1166
フォロワー

概要

この戦略は,スマートファンド指数 (SMI) に基づく量化取引戦略である.この指数は,機関資金の運行状況を反映し,SMI指標の変化を観察して市場の将来の可能性のある傾向を判断する.投資家の感情に基づいて取引する戦略のタイプに属している.

戦略原則

この戦略の核心指標は,スマート・ファンド・インデックス (SMI) である.

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

ここでNはパラメータ周期数である.

SMIは,機関資金の流入と流出を反映している.SMIが上昇すると,資金の純流入が示され,スマート資金が上昇している.SMIが低下すると,資金の純流出が示され,スマート資金が減少している.

取引戦略は,SMIが上昇すると多額で,SMIが低下すると空白である.このようにして,スマートファンドの操作方向に従う.

戦略的優位性

  • 機関資金の操作を捉えるスマート資金指数
  • SMIの計算はシンプルで実行しやすい
  • 投資家の感情を反映し,市場の変化に敏感である
  • 複数の品種と複数の時間枠で使用可能
  • パラメータを最適化し,適応力がある

戦略リスク

  • SMI指数自体が遅滞する可能性があります.
  • 単一の指標で騙されやすい
  • 市場を区別できない技術分析が必要
  • ストップ・ローを効果的に制御できず,大きなリタイアがある
  • 品種と周期の最適化パラメータが必要

リスクを下げるには,以下の措置を講じます.

  • SMIの周期パラメータを最適化する
  • グラフィック技術指標と組み合わせた確認
  • ストップ・ダメージ・ストップ・ルールを設定し,リスクを制御する
  • 異なる品種と周期によるパラメータ最適化
  • ポジション管理システムの適切な調整

最適化の方向

この戦略は以下の点で最適化できます.

  1. テストはSMIの最適な周期数を計算します.

  2. SMI信号に基づいてMACDなどの指標のフィルタリングを追加

  3. 移動ストップまたは固定ポイントストップを追加する

  4. 異なる品種による最適123のパラメータをそれぞれ探す

  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")