Madrid

Madrid Trend Strength

MTS
590
mts
This indicator displays a vector that measures the direction and the strength of a trend. It is based on the Awesome Indicator (AO), the difference is this indicator can be customized to track different moving averages and keep track of either long or short term trends. It displays momentum direction too.
The parameters needed are two mandatory and three optional.
1. Fast MA Length. The length of the fast Moving Average
2. Slow MA Length. The length of the slow Moving Average (SlowMA > FastMA)
3. Signal Length. This is used to display the momentum.
4. Display Signal. Optionally the signal to determine momentum can be displayed as well.
5. Reverse view.
The default parameters are 34-89, but the values depend on which MA pairs you want to study, like 8-21, 21-55, 55-89, 55-144.
How to trade with the MTS indicator
1. Go long when the indicator is green
2. Go short when the indicator is red
3. If MTS is >0 and green : Long position
4. If MTS > 0 and red : entry/exit points. Take profits or scale up
5. If MTS < 0 and red : Short position
6. If MTS < 0 and green : entry/exit points. Take profits or scale up

Momentum Bar:
Lime = an uptrend in progress
Green = Still in uptrend but this signals a weakening trend or a possible reversal
Red = a downtrend in progress
Maroon = Still in downtrend but this signals a weakening trend or a possible reversal

오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?
// Madrid : 02/21/2104 : TrendStrength : 2.0 : This meassure the percentage
// Madrid : 05/29/2014 : 2.1 : Added the MTM indicator.
// Madrid : 05/31/2014 : 2.2 : Replaced src hl2 instead of close
// Madrid : 05/31/2014 : 2.3 : Parameter consolidation
// of the difference between two moving averages and determines the 
// strength and direction of the price move.
// The greater the number the stronger the move. A gray area is defined 
// around 3.5%, below this mark the market may become choppy.
// The Madrid Trend Strength Oscillator is based on the Awesome Oscillator,
// the difference is that the Madrid Trend Strength uses ema instead of sma
// which reduces the lagging of the sma.

study(title="Madrid Trend Strength", shorttitle="MTS", precision=2)
src =  hl2

// Input parameters
fastMALength = input(34, minval=1, title="Fast Length")
slowMALength = input(89, minval=1, title="Slow Length")
tsMA = input(13, title="Trend Strength MA")
displayMA = input(false, title="Display Trend MA")
reverseView = input(false, title="Reverse View")

fastMA = ema(src, fastMALength )
slowMA = ema(src, slowMALength )
trendStrength = reverseView? -1*(fastMA - slowMA)*100/slowMA : (fastMA - slowMA)*100/slowMA
threshold = 0
trendStrengthMA = sma(trendStrength, tsMA)

momentum = trendStrength-trendStrengthMA
colorMom = momentum>0 and change(momentum)>=0 ? lime
           : momentum>0 and change(momentum)< 0 ? green
           : momentum<0 and change(momentum)>=0 ? maroon 
           : momentum<0 and change(momentum)< 0 ? red
           : gray

colorTrend = change(trendStrength) > 0 ? green : red

// Output
plot(trendStrength, color=colorTrend, style=histogram, linewidth=2, title="TrendStrength")
plot(0, color=colorMom, style=line, linewidth=3, title="Divergence")
plot(displayMA?trendStrengthMA:na, color=change(trendStrengthMA[2])>0?green:red, linewidth=3)