lonestar108

ZLEMA/SMA Intersection

225 2 29
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
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
日本
한국
Home Stock Screener Forex Signal Finder 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 Account and Billing Sign Out