Volume histogram and reset on new day

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #13788 quote
    Henry
    Participant
    Average

    A request that was addressed to ProRealTime:

    I want to SUM volume like a histogram.

    I want this to work in a tick chart but also in larger frames.

    For tickchart this follows:

    Buy volume/positive volume:
    If close is above last close then add its volume as positive volume. And if next close is on the same price or above last close then also add volume to positive volume.

    Selling volume/ negative volume:
    If close is < the close[1] then add its volume as negative volume. And if next close is on the same price or below last close then also add volume to negative volume.

    Remember, close price can be equal close price like 30 times in a tick chart, i think this may be some of the tricky part.

    Think in terms of a tick chart and you can get a better visualization of it.

    I hope this will also work in like 1 hour chart.

     

    Suggestion for an anwser:

    You can set the variable zeroonnewday as you prefer.
    If you want to set the value as “0” at the beginning of the day, please  type zeroonnewday=1, otherwise type zeroonnewday=0

    zeroonnewday=1
    
    if zeroonnewday=1 and intradaybarindex=0 then
    upvolume=0
    downvolume=0
    endif
    
    once trend=0
    
    if close > close[1] and trend< 1 then
    upvolume=upvolume+volume
    trend=1
    elsif close < close[1] and trend > -1 then
    downvolume=downvolume-volume
    trend=-1
    elsif trend=-1 and close <= close[1] then
    downvolume=downvolume-volume
    elsif trend=1 and close >= close[1] then
    upvolume=upvolume+volume
    endif
    
    return upvolume as "positive volume",downvolume as "negative volume"
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Volume histogram and reset on new day


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Henry @henry Participant
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 09/27/2016
Status: Active
Attachments: No files
Logo Logo
Loading...