Painting bars by ATR and VOLUME

Forums ProRealTime English forum ProBuilder support Painting bars by ATR and VOLUME

Viewing 5 posts - 1 through 5 (of 5 total)
  • #231172

    I need a code for the indicator, using the following functions and variables:

    ATR: The Average True Range function calculates the true range of the price over a specified period.

    Volume: The Volume function returns the total volume traded over a specified period.

    Average Volume: You’ll need to calculate the average volume over a certain period, such as 14 days.

    Price: The current price of the security.

    Conditions: Create logical conditions based on your requirements.

    Color: Set the color of the bar based on the conditions met.

     

    The logic for the conditions would be as follows:

     

    if ATR > 2 * ATR[14] and Volume > AverageVolume and Price > Price[1]:

    Color = “DarkGreen”

    elif ATR > 2 * ATR[14] and Volume > AverageVolume and Price < Price[1]:

    Color = “DarkRed”

    else:

    Color = “DefaultColor”

     

    #231173
    JS

    Hi,

    Try this one:

     

    #231176

    Many thanks mate,

    but can I change the other bars to light gray instead of dark blue using “lightgray”

    #231178
    JS

    If the “other bars” need to be light grey, you can replace “DarkBlue” with “LightGrey”… (or just “Grey” as shown in the screenshot)

    DrawCandle(Open,High,Low,Close)Coloured(“LightGrey”)

    #231195

    Many thanks mate,

    1 user thanked author for this post.
    avatar JS
Viewing 5 posts - 1 through 5 (of 5 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login