스마트펀드 인덱스 전략 백테스팅


생성 날짜: 2023-09-21 21:14:02 마지막으로 수정됨: 2023-09-21 21:14:02
복사: 0 클릭수: 1107
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

개요

이 전략은 스마트 펀드 인덱스 (SMI) 를 기반으로 한 수량 거래 전략이다. 이 지수는 기관 자금의 작동 상황을 반영하며, SMI 지표의 변화를 통해 시장의 미래의 추세를 판단한다. 투자자의 감정을 기반으로 거래하는 전략 유형에 속한다.

전략 원칙

이 전략의 핵심 지표는 스마트 펀드 인덱스 (SMI) 이다.

SMI = SMA (오늘의 종결 가격 - 오늘의 개시 가격 + 어제의 종결 가격 - 어제의 개시 가격, N)

여기서 N은 변수의 주기수이다.

SMI는 기관 자금의 유입과 유출 상황을 반영한다. SMI가 상승하면 자금의 순 유입을 의미하며, 지능형 자금의 부진을 나타냅니다. SMI가 감소하면 자금의 순 유출을 의미하며, 지능형 자금의 부진을 나타냅니다.

거래 전략은 SMI가 올라갈 때 더 많이 하고, SMI가 내려갈 때 더 적게 하는 것이다.

전략적 이점

  • 스마트 펀드 지수 기반의 기관 펀드 조작을 포착하는 방법
  • SMI의 계산은 간단하고 실행하기 쉽습니다.
  • 투자자의 감정을 반영하고 시장 변화에 민감합니다.
  • 다중 종과 다중 시간 프레임에서 사용할 수 있습니다.
  • 최적화 가능, 적응력 강

전략적 위험

  • SMI 지표 자체는 지연될 수 있습니다.
  • 단 하나의 지표만으로도 쉽게 속일 수 있습니다.
  • 공백시장을 구분할 수 없고 기술 분석이 필요합니다.
  • 제2차 세계대전 당시의 경제상황
  • 품종 및 주기 최적화 매개 변수

위험은 다음과 같은 방법으로 줄일 수 있습니다.

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