wma
209 1 44
wma
This is a 3 time frame weighted moving average . It can help guide trades on a smaller time frame by showing larger timeframe trend.
Remove from Favorite Scripts Add to Favorite Scripts
study("WMAMulti", overlay=true)

tf1 = input(title="time frame 1", defval="15")
tf2 = input(title="time frame 2", defval="30")
tf3 = input(title="time frame 3", defval="60")
length = input(title="length", defval=20)

ma1 = security(tickerid, tf1, wma(hl2, length))
ma2 = security(tickerid, tf2, wma(hl2, length))
ma3 = security(tickerid, tf3, wma(hl2, length))

getcolor (avg, tf) =>
    prev = security(tickerid, tf, wma(hl2, length)[1])
    avg >= prev ? green : red
   
plot(ma3, color=getcolor(ma3, tf3), style=line, linewidth=3)
plot(ma2, color=getcolor(ma2, tf2), style=line, linewidth=3)
plot(ma1, color=getcolor(ma1, tf1), style=line, linewidth=3)
accidentjev2
a year ago
Cool, thanks
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