nboone

LWMA w/ Color Change

Linear Weighted MA that changes colors based on slope.

Green = slope up from last bar
Yellow = slope is 0 from last bar
Red = slope down from last bar
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
study("LWMA w/ Color Change", shorttitle="LWMA", overlay=true)

p = input(defval=35, title="Period", minval=1)

ma = wma(close, 35)

c = ma[1] > ma[2] ? green : ma[1] < ma[2] ? red : yellow
    
plot(ma[1], color=c)
This version does not allow the period to be changed. See the latest version for that feature.
Reply
nboone nboone
LWMA w/ Color Change

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 Priority Support Contact Support Ideas Published Followers Following Private Messages Chat Sign Out