BB2H on 15min TF
Forums › ProRealTime English forum › ProBuilder support › BB2H on 15min TF
- This topic has 7 replies, 3 voices, and was last updated 4 years ago by Vonasi.
-
-
04/10/2019 at 7:16 PM #95999
Hello,
I’m looking to display the bollinger bands of the 2H TF on a 15min chart. I was able to draft the code here below, but calculation is off a few points vs the actual values and I can’t find why. Maybe someone could see if there is an error in my code.
1234567891011121314151617181920DEFPARAM CalculateOnLastBars = 1000//taking the close every 2HIF hour <> hour[1] and (hour=1 or hour = 3 or hour = 5 or hour = 7 or hour = 9 or hour = 11 or hour = 13 or hour = 15 or hour = 17 or hour = 19 or hour = 21 or hour=23) THENH2close = close//taking the current price into account alsoif currenttime+10000-opentime<1499 and date=today thenH2close = closeendifBBDown = Average[160](H2Close)-2.5*std[160](H2Close)BBUp = Average[160](H2Close)+2.5*std[160](H2Close)RETURN BBDown,BBUpThank you in advance,
04/11/2019 at 8:23 AM #96020Because you want to make an average of a non linear data serie.
160 times the value of H2Close doesn’t mean that you are using 160 different values of it, because the data array of your H2Close is linear, it means that it follows the time passing by with the bar counts.
04/11/2019 at 9:26 AM #9603704/11/2019 at 9:32 AM #9603904/11/2019 at 10:24 AM #96045With a loop and some headaches, it is possible without variables arrays, but not the best solution around.
You should have a look at examples made with GRAPHONPRICE, like Vonasi said, here: GRAPHONPRICE
04/11/2019 at 6:28 PM #96161Thx Nicolas and Vonasi for your remarks. Graphonprice is cool but I would prefer to keep my screens light, and I usually use a small segment on the right side to display different level of price from higher TF. So I will give a try. I haven’t seen a post with the kind of loop required, so if you have an idea..
05/23/2019 at 5:18 PM #9926305/23/2019 at 5:50 PM #99266I finally found a way to code it.
Care to share it? The code might be of interest to others trying to do the same thing.
-
AuthorPosts
Find exclusive trading pro-tools on