
이 전략은 동력 지표에 기반한 단기 거래 전략이라고 불린다. 동력 지표인 매스 인덱스를 사용하여 시장 추세의 전환점을 식별하여 단기 거래 기회를 잡는다.
이 전략은 두 세트의 다른 변수들의 지수 이동 평균 EMA를 사용하여 가격의 최고 가격과 최저 가격의 차이를 평평하게 하고, Mass Index이라는 지표를 얻는다. Mass Index 위에 어떤 절벽을 통과할 때 공백을 하고, Mass Index 아래에 어떤 절벽을 통과할 때 더 많이 한다.
구체적으로, 먼저 최고 가격과 최저 가격의 차이를 계산한다. xPrice. 그리고 xPrice의 9주기 및 25주기 EMA를 계산한다. 각각 xEMA와 xSmoothXAvg라고 명명한다.
이 전략은 매스 인덱스의 상하위 돌파구를 사용하여 트렌드 전환점을 판단하여 단기 거래를 한다. 시장의 흔들림이 심해지면 매스 인덱스는 상승할 것이며, 시장의 흔들림이 약해지면 매스 인덱스는 하락할 것이다. 특정 수준의 돌파구를 모니터링하면 단기 거래 기회를 효과적으로 잡을 수 있다.
이 전략은 다음과 같은 장점을 가지고 있습니다.
이 전략에는 몇 가지 위험도 있습니다.
이 전략은 다음과 같은 부분에서 최적화될 수 있습니다.
이 전략은 매스 인덱스 지표에 기반한 비교적 간단한 단기 거래 전략을 설계하여 시장의 전환점을 효과적으로 식별하여 정확하게 더 많은 공백을 할 수 있습니다. 이 전략의 거래 전략과 매개 변수 설정은 간단하고 직관적이며, 실행하기 쉽고, 다양한 시장 환경에 따라 조정 및 최적화 할 수 있으며, 강력한 실용성을 가지고 있습니다. 그러나 데이터 과다 조정 및 지표의 실패의 위험도 주의해야하며, 추세 판단과 손해 방지 조치를 결합하여 시장의 불확실성에 대처해야합니다.
/*backtest
start: 2023-02-20 00:00:00
end: 2024-02-26 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 12/09/2017
// The Mass Index was designed to identify trend reversals by measuring
// the narrowing and widening of the range between the high and low prices.
// As this range widens, the Mass Index increases; as the range narrows
// the Mass Index decreases.
// The Mass Index was developed by Donald Dorsey.
//
// You can change long to short in the Input Settings
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
strategy(title="MASS Index", shorttitle="MASS Index")
Length1 = input(9, minval=1)
Length2 = input(25, minval=1)
Trigger = input(26.5, step = 0.01)
reverse = input(false, title="Trade reverse")
hline(27, color=blue, linestyle=line, title = "Setup")
hline(Trigger, color=red, linestyle=line, title = "Trigger")
xPrice = high - low
xEMA = ema(xPrice, Length1)
xSmoothXAvg = ema(xEMA, Length1)
nRes = sum(iff(xSmoothXAvg != 0, xEMA / xSmoothXAvg, 0), Length2)
pos = iff(nRes > Trigger, -1,
iff(nRes < Trigger, 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(nRes, color=red, title="MASS Index")