Madrid

Madrid Moving Average

This plots the moving averages, either exponential or standard. When it is declining it shows the MA in red, green when rising.
Trading MA: Bullish when it is rising, Bearish when it is falling

Skrypt open-source

Zgodnie z prawdziwym duchem TradingView, autor tego skryptu opublikował go jako open-source, aby traderzy mogli go zrozumieć i zweryfikować. Brawo dla autora! Możesz używać go za darmo, ale ponowne wykorzystanie tego kodu w publikacji jest regulowane przez Dobre Praktyki. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.

Chcesz użyć tego skryptu na wykresie?
//
// Madrid : 03/30/2014 : Moving Average : 2.0
// http://madridjourneyonws.blogspot.com/
//
// This plots the moving averages, either exponential or standard
// When it is declining it shows the MA in red, green when rising.
// Trading MA: Bullish when it is rising, Bearish when it is falling
//

study(title="Madrid Moving Average", shorttitle="MMA", overlay=true)
maLen = input(21,  minval=1, title="MA Length")
exponential = input(true)

src = close
ma = exponential ? ema(src, maLen) : sma(src, maLen)

maColor = change(ma)>0 ? green : change(ma)<0 ? red : na
plot( ma, color=maColor, style=line, title="MMA", linewidth=2)