164 1 68
Show Daily level SMAs on chart regardless of current interval.
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
study("DMAs", overlay=true)

// options
n1on = input(false, title="5 DMA")
n2on = input(false, title="10 DMA")
n3on = input(false, title="20 DMA")
n4on = input(true, title="50 DMA")
n5on = input(true, title="100 DMA")
n6on = input(false, title="150 DMA")
n7on = input(false, title="200 DMA")

plot((n1on)?security(tickerid, "D", sma(close, 5)):na, title="5 DMA", color=#970000, linewidth=1, style=line, transp=0)
plot((n2on)?security(tickerid, "D", sma(close, 10)):na, title="10 DMA", color=red, linewidth=1, style=line, transp=0)
plot((n3on)?security(tickerid, "D", sma(close, 20)):na, title="20 DMA", color=#FF9800, linewidth=1, style=line, transp=0)
plot((n4on)?security(tickerid, "D", sma(close, 50)):na, title="50 DMA", color=yellow, linewidth=1, style=line, transp=0)
plot((n5on)?security(tickerid, "D", sma(close, 100)):na, title="100 DMA", color=lime, linewidth=1, style=line, transp=0)
plot((n6on)?security(tickerid, "D", sma(close, 150)):na, title="150 DMA", color=#00FFFF, linewidth=1, style=line, transp=0)
plot((n7on)?security(tickerid, "D", sma(close, 200)):na, title="200 DMA", color=#4985E7, linewidth=1, style=line, transp=0)
Created as USOIL was coming into 100DMA
Reply
United States
United Kingdom
India
Deutschland
France
España
Italia
Polska
Türkiye
Россия
Brasil
Indonesia
Malaysia
ประเทศไทย
Việt Nam
日本
한국
简体
繁體
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out