Volume bar Color Thresholds

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #237712 quote
    trwcapital
    Participant
    New

    I’m looking to color volume bars based on variable thresholds (for example if volume>400k then color orange, if > 1M then color pink, etc). Is there a way to do this with the built in volume indicator or can it be created in pro-builder code? I’ve tried my own take at it using something similar to the excerpt below but it is only showing regular trading hours volume. During pre and post market there are no volume bars.

     

    IF close > open AND Volume > q THEN
    upvoln = 0
    upvolm = 0
    upvolo = 0
    upvolp = 0
    upvolq = Volume
    downvoln = 0
    downvolm = 0
    downvolo = 0
    downvolp = 0
    downvolq = 0
    ELSIF close > open AND Volume > p THEN
    upvoln = 0
    upvolm = 0
    upvolo = 0
    upvolp = Volume
    upvolq = 0
    downvoln = 0
    downvolm = 0
    downvolo = 0
    downvolp = 0
    downvolq = 0

    #237749 quote
    Iván González
    Moderator
    Master

    Aquí tienes un ejemplo:

    q=400000
    p=1000000
    
    if volume>q and close>open then
    r=0
    g=255
    b=0
    elsif close>open then
    r=0
    g=255
    b=255
    elsif close<open and volume>p then
    r=255
    g=0
    b=0
    elsif close<open then
    r=255
    g=0
    b=255
    else
    r=124
    g=124
    b=124
    endif
    return volume style(histogram)coloured(r,g,b)
    
    trwcapital thanked this post
    #237779 quote
    trwcapital
    Participant
    New

    Beautiful. Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Volume bar Color Thresholds


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
trwcapital @trwcapital Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by trwcapital
1 year, 5 months ago.

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