RicardoSantos

[RS]SUPA MA OSC V0

144 2 16
request for coondawg71, hist form.
multiple moving averages , uses maximum plot() available.
can define base smoothness(lowest length ma) and incremental s.
Remove from Favorite Scripts Add to Favorite Scripts
study("[RS]SUPA MA OSC V0", overlay=false)
src = input(hl2)
sbase = input(1)
sadd = input(1)

ma00 = sma(src, sbase)
ma01 = sma(src, sbase + sadd)
ma02 = sma(src, sbase + sadd * 2)
ma03 = sma(src, sbase + sadd * 3)
ma04 = sma(src, sbase + sadd * 4)
ma05 = sma(src, sbase + sadd * 5)
ma06 = sma(src, sbase + sadd * 6)
ma07 = sma(src, sbase + sadd * 7)
ma08 = sma(src, sbase + sadd * 8)
ma09 = sma(src, sbase + sadd * 9)
ma10 = sma(src, sbase + sadd * 10)
ma11 = sma(src, sbase + sadd * 11)
ma12 = sma(src, sbase + sadd * 12)
ma13 = sma(src, sbase + sadd * 13)
ma14 = sma(src, sbase + sadd * 14)
ma15 = sma(src, sbase + sadd * 15)
ma16 = sma(src, sbase + sadd * 16)
ma17 = sma(src, sbase + sadd * 17)
ma18 = sma(src, sbase + sadd * 18)
ma19 = sma(src, sbase + sadd * 19)
ma20 = sma(src, sbase + sadd * 20)
ma21 = sma(src, sbase + sadd * 21)
ma22 = sma(src, sbase + sadd * 22)
ma23 = sma(src, sbase + sadd * 23)
ma24 = sma(src, sbase + sadd * 24)
ma25 = sma(src, sbase + sadd * 25)
ma26 = sma(src, sbase + sadd * 26)
ma27 = sma(src, sbase + sadd * 27)
ma28 = sma(src, sbase + sadd * 28)
ma29 = sma(src, sbase + sadd * 29)
ma30 = sma(src, sbase + sadd * 30)
ma31 = sma(src, sbase + sadd * 31)

f_slope(_ma)=> _ma > _ma[1] ? 1 : _ma < _ma[1] ? -1 : 0
plot(1, style=columns, color=f_slope(ma00)==1?green:f_slope(ma00)==-1?maroon:gray, histbase=0)
plot(2, style=columns, color=f_slope(ma01)==1?green:f_slope(ma01)==-1?maroon:gray, histbase=1)
plot(3, style=columns, color=f_slope(ma02)==1?green:f_slope(ma02)==-1?maroon:gray, histbase=2)
plot(4, style=columns, color=f_slope(ma03)==1?green:f_slope(ma03)==-1?maroon:gray, histbase=3)
plot(5, style=columns, color=f_slope(ma04)==1?green:f_slope(ma04)==-1?maroon:gray, histbase=4)
plot(6, style=columns, color=f_slope(ma05)==1?green:f_slope(ma05)==-1?maroon:gray, histbase=5)
plot(7, style=columns, color=f_slope(ma06)==1?green:f_slope(ma06)==-1?maroon:gray, histbase=6)
plot(8, style=columns, color=f_slope(ma07)==1?green:f_slope(ma07)==-1?maroon:gray, histbase=7)
plot(9, style=columns, color=f_slope(ma08)==1?green:f_slope(ma08)==-1?maroon:gray, histbase=8)
plot(10, style=columns, color=f_slope(ma09)==1?green:f_slope(ma09)==-1?maroon:gray, histbase=9)
plot(11, style=columns, color=f_slope(ma10)==1?green:f_slope(ma10)==-1?maroon:gray, histbase=10)
plot(12, style=columns, color=f_slope(ma11)==1?green:f_slope(ma11)==-1?maroon:gray, histbase=11)
plot(13, style=columns, color=f_slope(ma12)==1?green:f_slope(ma12)==-1?maroon:gray, histbase=12)
plot(14, style=columns, color=f_slope(ma13)==1?green:f_slope(ma13)==-1?maroon:gray, histbase=13)
plot(15, style=columns, color=f_slope(ma14)==1?green:f_slope(ma14)==-1?maroon:gray, histbase=14)
plot(16, style=columns, color=f_slope(ma15)==1?green:f_slope(ma15)==-1?maroon:gray, histbase=15)
plot(17, style=columns, color=f_slope(ma16)==1?green:f_slope(ma16)==-1?maroon:gray, histbase=16)
plot(18, style=columns, color=f_slope(ma17)==1?green:f_slope(ma17)==-1?maroon:gray, histbase=17)
plot(19, style=columns, color=f_slope(ma18)==1?green:f_slope(ma18)==-1?maroon:gray, histbase=18)
plot(20, style=columns, color=f_slope(ma19)==1?green:f_slope(ma19)==-1?maroon:gray, histbase=19)
plot(21, style=columns, color=f_slope(ma20)==1?green:f_slope(ma20)==-1?maroon:gray, histbase=20)
plot(22, style=columns, color=f_slope(ma21)==1?green:f_slope(ma21)==-1?maroon:gray, histbase=21)
plot(23, style=columns, color=f_slope(ma22)==1?green:f_slope(ma22)==-1?maroon:gray, histbase=22)
plot(24, style=columns, color=f_slope(ma23)==1?green:f_slope(ma23)==-1?maroon:gray, histbase=23)
plot(25, style=columns, color=f_slope(ma24)==1?green:f_slope(ma24)==-1?maroon:gray, histbase=24)
plot(26, style=columns, color=f_slope(ma25)==1?green:f_slope(ma25)==-1?maroon:gray, histbase=25)
plot(27, style=columns, color=f_slope(ma26)==1?green:f_slope(ma26)==-1?maroon:gray, histbase=26)
plot(28, style=columns, color=f_slope(ma27)==1?green:f_slope(ma27)==-1?maroon:gray, histbase=27)
plot(29, style=columns, color=f_slope(ma28)==1?green:f_slope(ma28)==-1?maroon:gray, histbase=28)
plot(30, style=columns, color=f_slope(ma29)==1?green:f_slope(ma29)==-1?maroon:gray, histbase=29)
plot(31, style=columns, color=f_slope(ma30)==1?green:f_slope(ma30)==-1?maroon:gray, histbase=30)
plot(32, style=columns, color=f_slope(ma31)==1?green:f_slope(ma31)==-1?maroon:gray, histbase=31)
vdubus PRO
a year ago
not sure how to read that but..wow :)
Reply
ucsgears PRO
a year ago
Interesting work lad. Possibility for future heat maps..
+1 Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out