lonestar108

ZLEMA/SMA Intersection

Uses a 1 period zero lag EMA for the fast line, SMA for slow line. Shows intersection candles in lime for positive crosses, orange for negative crosses.
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
study("ZLEMA/SMA Intersection")

len1=input(title="Enter Short  Day", type=integer, defval=1)
src1=input(close, title="Source")

ema1=ema(src1, len1)
ema2=ema(ema1, len1)
d=ema1-ema2
short=ema1+d

len2=input(title="Enter Long Day", type=integer, defval=10)
src2=input(close, title="Source")
long = sma(src2,len2)

plot(short, color = green,title="Short",style = areabr)
plot(long, color = red,title="long",style =areabr)

plot(cross(short, long) ? short : na,color=(long-short <0 ? lime:orange),style = circles, linewidth = 5,title="Intersection Point")

src = close, len = 1
out = sma(src, len)

barcolor(cross(short,long) ?  (long-short <0 ? lime:orange):na)
plotchar(cross(short,long) ? short:na , char='!', location=location.absolute, color=black,title="Alarm", text="!")
FYI: The "ZLEMA" (Zero Lag EMA) is exactly the same as the "DEMA" (Double Exponential Moving Average).
Reply
ChartArt ChartArt
And using the 1 period DEMA or ZLEMA is 99% the same as the close price, maybe even 100% the same.
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