PRT 11 Indicator disappears from screen when visually scrolling at barindex+1
Forums › ProRealTime English forum › ProBuilder support › PRT 11 Indicator disappears from screen when visually scrolling at barindex+1
- This topic has 7 replies, 2 voices, and was last updated 4 years ago by Daniele Maddaluno.
-
-
12/01/2020 at 10:19 AM #152290
I have written this indicator: VWAP@Time Z-score .
Which I have published on PRC but it’s still not available at that precise moment (so meanwhile I post below the code):VWAP@Time Z-score12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970// VWAP@Time intraday Z-Score// 17.11.2020// Daniele Maddaluno//// startTime = 80000// endTime = 153000// smoothZscore = f// stdev = 2once posLev1=+stdev/2once negLev1=-stdev/2once posLev2=+stdevonce negLev2=-stdevif opentime < startTime or opentime > endTime thenn = 0zscoreT = 0priced = 0shared = 0summ = 0vwap = closevwapstd = 0elsen = n + 1// This if has been added just for plot reasonsif n <= 1 thenzscoreT = 0elsezscoreT = 190endifpriced = priced + (totalprice*volume)shared = shared + volumeif shared>0 thenvwap = priced/sharedsumm = summ + square(totalprice - vwap)vwapstd = sqrt(summ / n)endifendifif smoothZscore thenzscore = average[3]((close-vwap)/vwapstd)elsezscore = (close-vwap)/vwapstdendifif zscore>=posLev2 thendrawcandle(posLev2, posLev2*1.25, posLev2, posLev2*1.25) coloured(255, 0, 0, 100) bordercolor(0, 0, 0, 0)endifif zscore<=negLev2 thendrawcandle(negLev2, negLev2*1.25, negLev2, negLev2*1.25) coloured(0, 255, 0, 100) bordercolor(0, 0, 0, 0)endif// Manage the coloring of vwap mid lineif zscore > zscore[1] thendwapR = 0dwapG = 128dwapB = 192elsedwapR = 255dwapG = 0dwapB = 0endifreturn zscore coloured(dwapR, dwapG, dwapB, zscoreT) style(line, 2) as "Z-score", posLev1 coloured(168, 168, 168) style(line, 2) as "Level +stdev/2", posLev2 coloured(210, 210, 210) style(line, 2) as "Level +stdev", negLev1 coloured(168, 168, 168) style(line, 2) as "Level -stdev/2", negLev2 coloured(210, 210, 210) style(line, 2) as "Level -stdev", 0 coloured(168, 168, 168) style(dottedline) as "Level 0"I have noticed that sometimes it has a strange behaviour that I didn’t had on PRT v10.
Using this indicator, when horizontally scrolling at the barindex+1 bar (I mean the bar next the current one) the indicator completely disappears…
Values in the “current” bar seems to be computed correctly…
The main problem is that sometimes works, sometimes doesn’t, so I could not address any clear reason of the fault…
I don’t think it’s linked to the indicator because I’m pretty sure that I have never had that problem on v10 (but I can be wrong)…I have attached a video to show what I meant.
PRT v11.1 – 18.0_202 + IG (last update on 25 nov 2020)12/01/2020 at 11:32 AM #15229812/01/2020 at 11:38 AM #15229912/01/2020 at 1:53 PM #15231412/01/2020 at 2:27 PM #152316I’ll try ASAP and let you know
12/01/2020 at 2:53 PM #152317Yeah, it seems linked to the fact that in some bars there is no candle to plot.
In my specific case I solved adding this:addedTransparentCandle123if zscore<posLev2 and zscore>negLev2 thendrawcandle(0, 0, 0, 0) coloured(0, 0, 0, 0) bordercolor(0, 0, 0, 0)endifSo basically if I don’t want to plot a candle I plot it completely transparent (at 0,0,0,0 as ohlc)…
It’s just a workaround and I think that it should be solved on the platform too.
I’ll send a send a technical report as you suggested.
Thank you!12/09/2020 at 3:24 PM #15310312/10/2020 at 10:58 AM #153178Perfect! 🙂
-
AuthorPosts
Find exclusive trading pro-tools on