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.
Açık kaynak kodlu komut dosyası

Gerçek TradingView ruhuyla, bu betiğin yazarı, yatırımcının anlayabilmesi ve doğrulayabilmesi için onu açık kaynak olarak yayınladı. Yazarın eline sağlık! Bunu ücretsiz olarak kullanabilirsiniz, ancak bu kodun bir yayında yeniden kullanımı Kullanım Koşulları ile yönetilir. Bir grafikte kullanmak için favorilere ekleyebilirsiniz.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?
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)