Signals on different timeframes
Forums › ProRealTime English forum › ProBuilder support › Signals on different timeframes
- This topic has 11 replies, 6 voices, and was last updated 3 weeks ago by larouedegann.
-
-
12/22/2024 at 7:28 PM #241705
Ivan kindly built the code for zero lag buy and sell indicator from AlgoAlpha (This Zero-Lag BUY SELL Indicator Makes All The Others OBSOLETE). I was wondering if anyone could enhance the code to add the signals across the different timeframes as per the screenshot.
Attached is the code and a screenshot of the table I’m seeking to add.
Thanks
12/22/2024 at 8:22 PM #24171112/22/2024 at 8:59 PM #241714Hi @LucasBest
Can you explain your remark?
12/22/2024 at 9:22 PM #241716Hi @LucasBest
Can you explain your remark?
Well, look at the picture, when the buy signal is given by the indicatore, the price go down and vice versa… That is not no lag for me as it is little bit too late to enter there…
So i think it ‘s funny to say “no lag” when it is abviously too late…12/22/2024 at 9:36 PM #241718This is because the wrong “zero lag” formula is being used…
The “zero lag” formula in use is only intended for simple moving averages, as the average is approximately in the middle of the “window”…
The window is equal to the period (N).
Zerolag = Round((N-1)/2)
When applied to an exponential moving average, the average is no longer in the middle of the “window.” This is because in an EMA, emphasis is placed on recent prices, causing the average to shift forward, and so the zero lag formula is no longer accurate…12/22/2024 at 11:38 PM #241720I’ve been testing this indicator and it better used as a ‘band’ which attracts price and then it can be used for entry and stops. Should align to other indicators for confluence. If you back test it you will see how this acts as a zone. The ZLMA has been around for a while so not a new concept.
12/24/2024 at 9:32 AM #241744Hi! I already did it.
https://www.prorealcode.com/topic/zero-lag-trend-signals-indicator-by-algoalpha/12/24/2024 at 10:33 AM #24174612/25/2024 at 1:25 AM #24178212/25/2024 at 11:47 AM #241784Hi @adeelq79
Here’s the basic version…
Use enough units to calculate all the averages correctly and as expected, the combination of five timeframes and their corresponding units is a challenge for your computer… 🙂
Zero Lag Trend Signals MTF1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889DefParam DrawOnLastBarOnly=Truelength=20mult=1.2src=closeTimeFrame(5 minutes)lag=floor((length-1)/2)myzlema5=average[length,1](src+(src-src[lag]))atr5=averagetruerange[length](close)volatil5=highest[length*3](atr5)*multif close > myzlema5+volatil5 thenDrawText("TF 5min",-300,-50,SansSerif,Bold,15)Anchor(TopRight)Coloured("Grey")DrawText("Bullish",-200,-50,SansSerif,Bold,15)Anchor(TopRight)Coloured("Green")elsif close < myzlema5-volatil5 thenDrawText("TF 5min",-300,-50,SansSerif,Bold,15)Anchor(TopRight)Coloured("Grey")DrawText("Bearish",-100,-50,SansSerif,Bold,15)Anchor(TopRight)Coloured("Red")elseDrawText("TF 5min",-300,-50,SansSerif,Bold,15)Anchor(TopRight)Coloured("Grey")DrawText("Neutral",-100,-50,SansSerif,Bold,15)Anchor(TopRight)Coloured("White")EndIfTimeFrame(15 minute)myzlema15=average[length,1](src+(src-src[lag]))atr15=averagetruerange[length](close)volatil15=highest[length*3](atr15)*multif close > myzlema15+volatil15 thenDrawText("TF 15min",-300,-75,SansSerif,Bold,15)Anchor(TopRight)Coloured("Grey")DrawText("Bullish",-200,-75,SansSerif,Bold,15)Anchor(TopRight)Coloured("Green")elsif close < myzlema15-volatil15 thenDrawText("TF 15min",-300,-75,SansSerif,Bold,15)Anchor(TopRight)Coloured("Grey")DrawText("Bearish",-100,-75,SansSerif,Bold,15)Anchor(TopRight)Coloured("Red")elseDrawText("TF 15min",-300,-75,SansSerif,Bold,15)Anchor(TopRight)Coloured("Grey")DrawText("Neutral",-100,-75,SansSerif,Bold,15)Anchor(TopRight)Coloured("White")endifTimeFrame(1 hour)myzlema1H=average[length,1](src+(src-src[lag]))atr1H=averagetruerange[length](close)volatil1H=highest[length*3](atr1H)*multif close > myzlema1H+volatil1H thenDrawText("TF 1hour",-300,-100,SansSerif,Bold,15)Anchor(TopRight)Coloured("Grey")DrawText("Bullish",-200,-100,SansSerif,Bold,15)Anchor(TopRight)Coloured("Green")elsif close < myzlema1H-volatil1H thenDrawText("TF 1hour",-300,-100,SansSerif,Bold,15)Anchor(TopRight)Coloured("Grey")DrawText("Bearish",-100,-100,SansSerif,Bold,15)Anchor(TopRight)Coloured("Red")elseDrawText("TF 1hour",-300,-100,SansSerif,Bold,15)Anchor(TopRight)Coloured("Grey")DrawText("Neutral",-100,-100,SansSerif,Bold,15)Anchor(TopRight)Coloured("White")endifTimeFrame(4 hour)myzlema4H=average[length,1](src+(src-src[lag]))atr4H=averagetruerange[length](close)volatil4H=highest[length*3](atr4H)*multif close > myzlema4H+volatil4H thenDrawText("TF 4hour",-300,-125,SansSerif,Bold,15)Anchor(TopRight)Coloured("Grey")DrawText("Bullish",-200,-125,SansSerif,Bold,15)Anchor(TopRight)Coloured("Green")elsif close < myzlema4H-volatil4H thenDrawText("TF 4hour",-300,-125,SansSerif,Bold,15)Anchor(TopRight)Coloured("Grey")DrawText("Bearish",-100,-125,SansSerif,Bold,15)Anchor(TopRight)Coloured("Red")elseDrawText("TF 4hour",-300,-125,SansSerif,Bold,15)Anchor(TopRight)Coloured("Grey")DrawText("Neutral",-100,-125,SansSerif,Bold,15)Anchor(TopRight)Coloured("White")endifTimeFrame(1 day)myzlema1D=average[length,1](src+(src-src[lag]))atr1D=averagetruerange[length](close)volatil1D=highest[length*3](atr1D)*multif close > myzlema1D+volatil1D thenDrawText("TF 1day",-300,-150,SansSerif,Bold,15)Anchor(TopRight)Coloured("Grey")DrawText("Bullish",-200,-150,SansSerif,Bold,15)Anchor(TopRight)Coloured("Green")elsif close < myzlema1D-volatil1D thenDrawText("TF 1 day",-300,-150,SansSerif,Bold,15)Anchor(TopRight)Coloured("Grey")DrawText("Bearish",-100,-150,SansSerif,Bold,15)Anchor(TopRight)Coloured("Red")elseDrawText("TF 1 day",-300,-150,SansSerif,Bold,15)Anchor(TopRight)Coloured("Grey")DrawText("Neutral",-100,-150,SansSerif,Bold,15)Anchor(TopRight)Coloured("White")endifreturn (myzlema5+volatil5)as "zlema5+vol5" Coloured("Red"),(myzlema5-volatil5) as "zlema5-vol5" Coloured("Red"),(myzlema15+volatil15)as "zlema15+vol15" Coloured("Green"),(myzlema15-volatil15) as "zlema15-vol15" Coloured("Green"),(myzlema1H+volatil1H)as "zlema1H+vol1H" Coloured("Blue"),(myzlema1H-volatil1H) as "zlema1H-vol1H" Coloured("Blue"),(myzlema4H+volatil4H)as "zlema4H+vol4H" Coloured("Yellow"),(myzlema4H-volatil4H) as "zlema4H-vol4H" Coloured("Yellow"),(myzlema1D+volatil1D)as "zlema1D+vol1D" Coloured("Purple"),(myzlema1D-volatil1D) as "zlema1D-vol1D" Coloured("Purple")2 users thanked author for this post.
12/26/2024 at 11:41 AM #24179712/31/2024 at 2:52 PM #242004YOU can see that
-
AuthorPosts
Find exclusive trading pro-tools on