RicardoSantos

[RS]JR Moving Average System V1.b

update: changes to code, ma's now split over 3 sets fast, medium and slow, removed cloud and sl_lines(no use?), ma's visually display as shapes :p added option to toggle the ma's on/off.
Open-source Skript

Ganz im Spirit von TradingView hat der Autor dieses Skripts es als Open-Source veröffentlicht, damit Trader es besser verstehen und überprüfen können. Herzlichen Glückwunsch an den Autor! Sie können es kostenlos verwenden, aber die Wiederverwendung dieses Codes in einer Veröffentlichung unterliegt den Hausregeln. Sie können es als Favoriten auswählen, um es in einem Chart zu verwenden.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.

Möchten Sie dieses Skript auf einem Chart verwenden?
study(title="[RS]JR Moving Average System V1.b", shorttitle="[RS]JR.MAS.V1b", overlay=true)

//  ||---   Median Line.
median = sma(hl2, input(1))
//  ||---   Fast MA's
fastmas = input(2)
fastma1 = wma(open, fastmas)
fastma2 = ema(open, fastmas)
//  ||---   Medium MA's
mediummas = input(8)
mediumma1 = wma(open, mediummas)
mediumma2 = ema(open, mediummas)
//  ||---   Slow MA's
slowmas = input(32)
slowma1 = wma(open, slowmas)
slowma2 = ema(open, slowmas)
//  ||---
hidemediumline = input(false)
risingmediumma1 = mediumma1 > mediumma1[1] and mediumma2 > mediumma2[1] ? mediumma1 : na
risingmediumma1color = risingmediumma1 ? green : na
plotshape(hidemediumline ? na : risingmediumma1, style=shape.triangleup, color=risingmediumma1color, location=location.absolute)

fallingmediumma1 = mediumma1 < mediumma1[1] and mediumma2 < mediumma2[1] ? mediumma1 : na
fallingmediumma1color = fallingmediumma1 ? maroon : na
plotshape(hidemediumline ? na : fallingmediumma1, style=shape.triangledown, color=fallingmediumma1color, location=location.absolute)
//---
//  ||---
hideslowline = input(false)
risingslowma1 = slowma1 > slowma1[1] and slowma2 > slowma2[1] ? slowma1 : na
risingslowma1color = risingslowma1 ? green : na
plotshape(hideslowline ? na : risingslowma1, style=shape.triangleup, color=risingslowma1color, location=location.absolute)

fallingslowma1 = slowma1 < slowma1[1] and slowma2 < slowma2[1] ? slowma1 : na
fallingslowma1color = fallingslowma1 ? maroon : na
plotshape(hideslowline ? na : fallingslowma1, style=shape.triangledown, color=fallingslowma1color, location=location.absolute)
//---
ma1color= fastma1 > fastma1[1] and fastma2 > fastma2[1] ? green : 
        fastma1 < fastma1[1] and fastma2 < fastma2[1] ? maroon : gray
plot(median, color=black)
//plotshape(fastma1, style=shape.diamond, color=ma1color, location=location.absolute)
//plot(ma2, color=silver)

condition = median >= fastma1 and fastma1 >= fastma2 ? (close >= open ? lime : green) :
        median <= fastma1 and fastma1 <= fastma2 ? (close >= open ? red : maroon) :
        median >= mediumma1 and mediumma1 >= mediumma2 ? (close >= open ? lime : green) :
        median <= mediumma1 and mediumma1 <= mediumma2 ? (close >= open ? red : maroon) :
        (close >= open ? silver : gray)

barcolor(condition)

//  ||---   Crossovers
buyx1 = cross(median,fastma1) and median >= median[1] ? true : false
sellx1 = cross(median,fastma1) and median <= median[1] ? true : false
plotshape(buyx1, style=shape.arrowup, color=green, location=location.belowbar)
plotshape(sellx1, style=shape.arrowdown, color=maroon, location=location.abovebar)