Bar Color close above/below previous bar

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #213704 quote
    Daniel da CostaDaniel da Costa
    Participant
    Average

    I need help with the code to achieve this.

     

    If the bar closes above or below the previous bar high/low then color it x or y

    TIA

    #213705 quote
    JC_BywanJC_Bywan
    Moderator
    Master

    Good morning,

    you could try something like this, replacing yellow and blue with your colors from table here:

    COLOURED

     

    if close>high[1] then
     DRAWCANDLE(open, high, low, close) coloured("yellow")
    elsif close<low[1] then
     DRAWCANDLE(open, high, low, close) coloured("blue")
    endif
    
    return
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Bar Color close above/below previous bar


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by JC_BywanJC_Bywan
3 years, 4 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/25/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...