Hallo Nicolas,
thanks for the information. Considering the Volume Profile, I found your code/post: https://www.prorealcode.com/topic/bull-bear-volume-by-price-levels-2/. That’s exactly what I’m looking for. I also pasted the code below and in the attachment is the hourly chart with the VPOC (Yesterday) lines. I tried to add some additional functions, but it didn’t work. It would be great if you could add the following functions. Since the VPOC in the code and picture is for “yesterday”, also the following functions should be for “yesterday”. Every additional function can be a line/text like the VPOC below.
– Range: This is the previous Day range (yesterday), which is High/Low (Dhigh/Dlow PRT function)
– Volume Area: The Volume Area consists of the VPOC, Volume Area High and Volume Area Low. The Volume Area corresponds to 70 % (Input factor to change the percentage would be good) of the traded Volume for that day. Now, the Value Area High is calculated in relation to VPOC and 35 % of Volume above the VPOC. The Volume Area Low is also calculated in relation to VPOC and 35 % of Volume below the VPOC. TradingView provides these information about the Volume Profile – especially the information below the title “Calculation” could be useful: https://www.tradingview.com/wiki/Volume_Profile
– Summary of lines which are of interest (yesterday): Daily High/Low, VPOC, Volume Area high and Volume Area Low
– Also a developing VPOC for Today would be useful – The VPOC for Today starts to develop with the Exchange-Open.
– Finally, a function to plot the lines for Yesterday during a specific time period (x-axis) – e.g. Lines for Yesterday are plotted yesterday or today during 1 am to 8 am (Input factor to change the time period for the lines). The Line for todays developing VPOC could start wit the Exchange Open or also a Time range.
These function extensions would be very helpful and certainly a good new indicator for PRT, because this is used in a lot of other software platforms.
Best regards
defparam calculateonlastbars=200
//Input
ScaleFactor = 3
NbrBars=21
lookback=max(1, intradaybarindex)
//
hh=highest[lookback](high)
ll=lowest[lookback](low)
div = (hh-ll)/NbrBars
i=0
volsum=summation[lookback](volume)
maxbar = 0
while i<NbrBars do
lrange=ll+div*i
hrange=lrange+div
volbull=0
volbear=0
for j = 1 to lookback do
if close[j]>=lrange and close[j]<=hrange then
if close[j]>open[j] then
volbull=volbull+volume[j]
else
volbear=volbear+volume[j]
endif
endif
next
bullbar = round((volbull*lookback)/volsum)*scalefactor
bearbar = round((volbear*lookback)/volsum)*scalefactor
//VPOC
if(bullbar>maxbar) then
vpoclevel = (lrange+hrange)/2
maxbar=bullbar
endif
if(bearbar>maxbar) then
vpoclevel = (lrange+hrange)/2
maxbar=bearbar
endif
i=i+1
wend
if intradaybarindex=1 then
yesterdayVPOC=vpoclevel[2]
drawtext(" -----------------------------------------------",barindex[2],yesterdayVPOC,dialog,bold,15) coloured(0,0,0)
endif
return