Color Code a specific day of the week

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #235362 quote
    dmacp325
    Participant
    New

    Hi – am new here (and to coding)

    Does anyone know how (or if is even possible) to color a candle on a specific day-of-the week a particular color please?

    EG: want to make every FRIDAY turn a specific color regardless of whether it’s an up/down day

    Many thanks in advance, and good trading to you all !!

    Thanks

    D

    #235364 quote
    druby
    Participant
    New

    Run this indicator in the price chart.

    Changing the value of ‘opendayofweek’ sets the day, 0 – 6.

    Changing the RGB values sets the colour, 0-255.

    The indicator should overwrite the price candle’s with the day/colour chosen.

     

    // day
    if opendayofweek = 5 THEN  // smtwtfs , 0 - 6 
    
    // colour
    r = 255                 // r,g,b,a   0 - 255
    g = 0
    b = 255
    a = 255
    
    drawcandle(open,high,low,close)coloured(r,g,b,a)bordercolor(255,255,255,175)
    endif
    
    return
    dmacp325 and Iván González thanked this post
    #235365 quote
    Iván González
    Moderator
    Master

    Here you have an example:

    if DayOfWeek = 5 THEN 
    DRAWCANDLE(open, high, low, close) coloured("fuchsia")
    ENDIF 
    
    return 
    druby and dmacp325 thanked this post
    #235373 quote
    dmacp325
    Participant
    New

    thank you so much Druby and Ivan – i really appreciate your help with this – thanks !!

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

Color Code a specific day of the week


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
dmacp325 @dmacp325 Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by dmacp325
1 year, 6 months ago.

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