Bollinger Previous Days
Forums › ProRealTime English forum › ProScreener support › Bollinger Previous Days
- This topic has 11 replies, 3 voices, and was last updated 2 years ago by robertogozzi.
-
-
12/01/2021 at 10:50 AM #182577
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!
12/01/2021 at 11:13 AM #182582Try defining and using MyBB[n]:
12345MyBB = BollingerDown[20](Close)IF MyBB[2] THEN..ENDIF12/01/2021 at 11:40 AM #18258512345BBInf = BollingerDown[20](close)c1 = DHigh(1) <= BBInf[1]*1.015SCREENER [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
12/01/2021 at 12:48 PM #182596Beacuse 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.
1 user thanked author for this post.
12/01/2021 at 1:02 PM #182599Thanks 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.
12345BBInf = BollingerDown[20](close)c1 = High[1] <= BBInf[1]*1.015SCREENER(c1)Also, Im not referencing to any previous days, so the 1024 limit should not affect.
Thanks!
12/01/2021 at 4:18 PM #182623Replace the last line with:
1SCREENER[c1]12/01/2021 at 4:20 PM #18262412/01/2021 at 4:34 PM #18262712/01/2021 at 4:39 PM #18262812/01/2021 at 5:06 PM #182634It works finely for me.
Is it possible that you typed * 1.015, instead of 0.985?
12/02/2021 at 12:05 PM #182706I 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.
1 user thanked author for this post.
12/02/2021 at 12:37 PM #182708Thank you for letting us know about this issue 🙂
-
AuthorPosts
Find exclusive trading pro-tools on