Bar Color close above/below previous bar

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #213704 quote
    Daniel 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_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.

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_Bywan
2 years, 9 months ago.

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