스마트 머니 인덱스 (SMI) 전략 백테스트

저자:차오장, 날짜: 2023-09-21 21:14:02
태그:

전반적인 설명

이는 스마트 머니 인덱스 (SMI) 를 기반으로 한 양적 거래 전략이다. 인덱스는 기관 자금의 활동을 반영하며 SMI 움직임을 분석하여 잠재적 인 시장 추세를 예측하는 데 사용됩니다. 투자자 정서 분석을 기반으로하는 거래 전략에 속합니다.

전략 논리

핵심 지표는 스마트 머니 인덱스 (SMI) 이다. 그 계산 공식은:

SMI = SMA (오늘의 종료 - 오늘의 오픈 + 어제의 종료 - 어제의 오픈, N)

여기서 N는 매개 변수 기간입니다.

SMI는 스마트 화폐의 유입과 유출을 반영합니다. 상승하는 SMI는 순액 유입을 나타냅니다. 즉 스마트 화폐는 상승합니다. 떨어지는 SMI는 순액 유출을 나타냅니다. 즉 스마트 화폐는 하락합니다.

거래 전략은 SMI가 상승할 때 길고 SMI가 떨어질 때 짧습니다. 스마트 화폐의 움직임을 따라가기 위해서죠.

장점

  • SMI를 기반으로 스마트 돈 활동을 포착합니다.
  • 간단한 SMI 계산, 쉽게 구현
  • 시장 변화에 민감한 투자자 정서를 반영합니다.
  • 제품 및 시간 프레임에 적용
  • 적응성을 위해 조정 가능한 매개 변수

위험성

  • SMI 자체는 늦어질 수 있습니다.
  • 단 하나의 지표에 의존하는 윙사 (wipssaws) 에 유연합니다.
  • 황소 시장과 곰 시장을 구분할 수 없습니다.
  • 실질적인 중단이 없고, 큰 마이너오웃
  • 매개 변수는 제품 및 시간 기준으로 최적화되어야 합니다.

위험은 다음과 같이 감소 할 수 있습니다.

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

더 많은