Zero Lag Trend Signals Indicator by AlgoAlpha
Forums › ProRealTime English forum › ProBuilder support › Zero Lag Trend Signals Indicator by AlgoAlpha
- This topic has 18 replies, 7 voices, and was last updated 2 weeks ago by jacquesgermain.
-
-
11/13/2024 at 3:58 PM #240318
Hi all,
Is it possible to code the following indicator “Zero Lag Trend Signals Indicator by AlgoAlpha” to work on ProRealCode – found here:(175) This Zero-Lag BUY SELL Indicator Makes All The Others OBSOLTE – YouTube
Thanks
11/15/2024 at 10:45 AM #240396Done:
Zero Lag Trend Signals1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768//-------------------------------------////PRC_Zero Lag Trend Signals//version = 0//15.11.24//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//-------------------------------------////---Inputs//-------------------------------------//length=70mult=1.2src=close//-------------------------------------//// Zlema calculation//-------------------------------------//lag=floor((length-1)/2)myzlema=average[length,1](src+(src-src[lag]))//-------------------------------------//// Volatility calculation//-------------------------------------//atr=averagetruerange[length](close)volatil=highest[length*3](atr)*mult//-------------------------------------//// Trend condition//-------------------------------------//once trend=0if close crosses over myzlema+volatil thentrend=1r=0g=255elsif close crosses under myzlema-volatil thentrend=-1r=255g=0endif//-------------------------------------//// Signals and colors//-------------------------------------//if trend=-1 thenupper=myzlema+volatilalpha1=90lower=myzlemaalpha2=0if trend<>trend[1] thendrawarrowdown(barindex,upper+0.25*atr)coloured(r,g,0,175)endifelseupper=myzlemaalpha1=0lower=myzlema-volatilalpha2=90if trend<>trend[1] thendrawarrowup(barindex,lower-0.25*atr)coloured(r,g,0,175)endifendifif close crosses over myzlema and trend=1 and trend[1]=1 thendrawtext("▲",barindex,myzlema-volatil*1.5)coloured("green")elsif close crosses under myzlema and trend=-1 and trend[1]=-1 thendrawtext("▼",barindex,myzlema+volatil*1.5)coloured("red")endifif barindex > 4*length thencolorbetween(myzlema,upper,r,g,0,alpha1)colorbetween(myzlema,lower,r,g,0,alpha2)endif//-------------------------------------//return myzlema as "Zero Lag Basis"style(line,2)coloured(r,g,0)11/23/2024 at 12:24 AM #24068011/25/2024 at 11:39 PM #24073912/28/2024 at 12:22 PM #241845here is the indicator with the table as described in the video. it informs you if the trend is bullish or bearish on 4 different timeframes .
be careful you must use it in time units of 5 minutes
1//PRC_Zero Lag Trend Signals
timeframe(5mn)
length=70
mult=1.2
src=close
lag=floor((length-1)/2)
myzlema=average[length,1](src+(src-src[lag]))
atr=averagetruerange[length](close)
volatil=highest[length*3](atr)*multonce trend=0
if close crosses over myzlema+volatil then
trend=1
r=0
g=255
elsif close crosses under myzlema-volatil then
trend=-1
r=255
g=0
endif
if trend=-1 then
upper=myzlema+volatil
alpha1=90
lower=myzlema
alpha2=0
if trend<>trend[1] then
drawarrowdown(barindex,upper+0.25*atr)coloured(r,g,0,175)
endif
else
upper=myzlema
alpha1=0
lower=myzlema-volatil
alpha2=90
if trend<>trend[1] then
drawarrowup(barindex,lower-0.25*atr)coloured(0,128,0,175)
endif
endif
if close crosses over myzlema and trend=1 and trend[1]=1 then
drawtext(“▲”,barindex,myzlema-volatil*1.5)coloured(“green”)
elsif close crosses under myzlema and trend=-1 and trend[1]=-1 then
drawtext(“▼”,barindex,myzlema+volatil*1.5)coloured(“red”)
endif
if barindex > 4*length then
colorbetween(myzlema,upper,r,g,0,alpha1)
colorbetween(myzlema,lower,r,g,0,alpha2)
endif
if islastbarupdate then
if trend=1 then
DRAWTEXT(“bullish 5mn”,-100,-40,dialog,bold,12)coloured(0,150,0)anchor(topright,xshift,yshift)
else
DRAWTEXT(“bearish 5mn”,-100,-40,dialog,bold,12)coloured(150,0,0)anchor(topright,xshift,yshift)
endif
endif
timeframe (15mn)
myzlema15mn=average[length,1](src+(src-src[lag]))
atr15mn=averagetruerange[length](close)
volatil15mn=highest[length*3](atr15mn)*mult
once trend15mn=0
if close crosses over myzlema15mn+volatil15mn then
trend15mn=1
elsif close crosses under myzlema15mn-volatil15mn then
trend15mn=-1
endif
if islastbarupdate then
if trend15mn=1 then
DRAWTEXT(“bullish 15mn”,-100,-60,dialog,bold,12)coloured(0,150,0)anchor(topright,xshift,yshift)
else
DRAWTEXT(“bearish 15mn”,-100,-60,dialog,bold,12)coloured(150,0,0)anchor(topright,xshift,yshift)
endif
endif
timeframe (1h)
myzlema60mn=average[length,1](src+(src-src[lag]))
atr60mn=averagetruerange[length](close)
volatil60mn=highest[length*3](atr60mn)*mult
once trend60mn=0
if close crosses over myzlema60mn+volatil60mn then
trend60mn=1
elsif close crosses under myzlema60mn-volatil60mn then
trend60mn=-1
endif
if islastbarupdate then
if trend60mn=1 then
DRAWTEXT(“bullish 1heure”,-100,-80,dialog,bold,12)coloured(0,150,0)anchor(topright,xshift,yshift)
else
DRAWTEXT(“bearish 1heure”,-100,-80,dialog,bold,12)coloured(150,0,0)anchor(topright,xshift,yshift)
endif
endiftimeframe (4h)
myzlema240mn=average[length,1](src+(src-src[lag]))
atr240mn=averagetruerange[length](close)
volatil240mn=highest[length*3](atr240mn)*mult
once trend240mn=0
if close crosses over myzlema240mn+volatil240mn then
trend240mn=1
elsif close crosses under myzlema240mn-volatil240mn then
trend240mn=-1
endif
if islastbarupdate then
if trend240mn=1 then
DRAWTEXT(“bullish 4 heures”,-100,-100,dialog,bold,12)coloured(0,150,0)anchor(topright,xshift,yshift)
else
DRAWTEXT(“bearish 4 heures”,-100,-100,dialog,bold,12)coloured(150,0,0)anchor(topright,xshift,yshift)
endif
endif
timeframe (daily)
myzlema510mn=average[length,1](src+(src-src[lag]))
atr510mn=averagetruerange[length](close)
volatil510mn=highest[length*3](atr510mn)*mult
once trend510mn=0
if close crosses over myzlema510mn+volatil510mn then
trend510mn=1
elsif close crosses under myzlema510mn-volatil510mn then
trend510mn=-1
endif
if islastbarupdate then
if trend510mn=1 then
DRAWTEXT(“bullish 1 jour”,-100,-120,dialog,bold,12)coloured(0,150,0)anchor(topright,xshift,yshift)
else
DRAWTEXT(“bearish 1 jour”,-100,-120,dialog,bold,12)coloured(150,0,0)anchor(topright,xshift,yshift)
endif
endifreturn myzlema as “Zero Lag Trends Signals”style(line,2)coloured(r,g,0)
2 users thanked author for this post.
12/31/2024 at 7:20 PM #242015@jacquesgermain Thank You!!
01/01/2025 at 11:27 AM #242022Bonjour à tout le monde
J’ai essayé mais il y à des erreurs à la ligne 11-12-16-17 et je ne sais pas comment modifier le code
01/01/2025 at 12:37 PM #24202301/02/2025 at 12:50 PM #24206501/03/2025 at 7:35 PM #242125hello, watch this video it is very well explained : https://www.youtube.com/watch?v=X4l5kOsFYvQ
101/03/2025 at 11:37 PM #24213201/04/2025 at 10:25 AM #24213701/04/2025 at 11:30 PM #242170I have observed that when it changes direction, it will retest the ‘zone’ and that is a good place to go long or short – in line with the trend. The mini arrows I find are less accurate so I wait until there is the larger arrow that crosses over and wait for the retest.
01/05/2025 at 10:22 AM #242172Good morning
I find the indicator very interesting, but in the table it differs from the original indicator from Trading View. And even for example 15 minutes in the Germany spot market the individual indicator shows bearish, but the table shows bullish. That is of course a shame and can lead to misjudgments.01/05/2025 at 11:35 AM #242175I noted that too. The ‘ribbons’ match which is great but the Signals per Time Frame Table does not match the table from TradingView.
I was looking at the code to try and work out why but gave up rather rapidly.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on