Hi all,
I’m trying to refer to the value of a Bollinger Band from previous days however, my condition does not seem to apply correctly.
For instance, what would be the value of the lower Bollinger Band 2 days ago?
I’m trying the following with no success: BollingerDown[20](Close[2]) or BollingerDown[20](Close)[2]
Thanks a lot!
Try defining and using MyBB[n]:
MyBB = BollingerDown[20](Close)
IF MyBB[2] THEN
.
.
ENDIF
BBInf = BollingerDown[20](close)
c1 = DHigh(1) <= BBInf[1]*1.015
SCREENER [c1]
Hi Roberto,
Thanks a lot for your swift response.
I tried your suggestion as per the example attached however it is still not working properly.
For example, there is a stock where yesterday’s High is 21.780 and yesterday’s lower Bollinger Band is 21.244
I want the condition to be true if yesterday’s High is equal or less than yesterday’s lower Bollinger Band plus 1.5%.
For this stock, the result of this condition would be False (21.244 * 1.015 = 21.563) however, the Proscreener is still showing it up.
Any thoughts on this? Grazie mille!
Alberto
Beacuse you are comparing different TFs.
That’s because (1) with DHIGH means that you get yesterdays’s DAILY high and you compare it with BBInf[1] wichi is not yesterday’s BB (unless you are using the Daily TF, in which case you can use HIGH[1] instead of DHIGH(1)), but the value of the BB on the previous candle. If you use it on a 1-hour TF, DHIGH is correct, but BBInf[1] is the value of the previous hour.
In addition, check that you do not reference more than 254 bars, which is the current limit with IG (1024 with PRT). So, if you are using a 1-minute TF, you won’t be able to make it work because you will need 1024 bars for today (maybe half of them at 12pm) + 1024 for the whole previous day, which are quite too many.
Thanks Roberto, my intention here is to do everything with Daily timeframe. So compare yesterday’s daily high, with yesterday’s lower bollinger band on the daily candle.
As per your example, I have simplified the reference to yesterday’s High, but still not been able to get it right. (I also tried introducing Timeframe(Daily) at the very beginning to force everything to be on daily basis but didnt work either.
BBInf = BollingerDown[20](close)
c1 = High[1] <= BBInf[1]*1.015
SCREENER(c1)
Also, Im not referencing to any previous days, so the 1024 limit should not affect.
Thanks!
Replace the last line with:
SCREENER[c1]
That was just a typo when re-writing the code here, it is correct on ProScreener.
Real time subscription? Or free “end of day” account?
Real Time, Premium account.
It works finely for me.
Is it possible that you typed * 1.015, instead of 0.985?
I just found out that my code is providing somewhat random (wrong) results, only when combining lists of different markets.
When selecting only Spain for instance, it seems to be working fine.
PRT told me they where experiencing some issues with american stocks so perhaps this is affecting proscreener.
Thanks to all for your kind attention.
Thank you for letting us know about this issue 🙂