Announcement

Collapse
No announcement yet.

set the bar background color bwtween ymin and ymax

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • set the bar background color bwtween ymin and ymax

    There is a function setBarBgColor( color [, series] [, yMin] [, yMax] )
    to set the background color between ymax and ymin. However it only works on the bar on which the main is being executed.

    How can I paint the background color between ymin and ymax for some old bars. For example, on 60min chart, I would like to calculate the overnight high and low (denoted as OH and OL) and paint the background of the overnight bars between OH and OL to lightgrey. Because OH and OL are finalized only when all overnight bars have been processed, therefore it seems I have to use setBar(Bar.BgColor, barindex, value) to set the background color of old bars. However setBar does not accept ymax and ymin as the y-axis parameters. If I don't want the script being self-reloaded once so that it can calculate OH and OL in the first run and paint the background in the second run, is there existing efs function similar to setBarBgColor( color [, series] [, yMin] [, yMax] ) but working on older bars?

    - Clearpicks

  • #2
    clearpicks
    At this time there isn't a function that will do that
    FWIW I requested a while back that the yMin and yMax optional parameters be added to the setBar() function and it is my understanding that this is going to be implemented at some point.
    Alex


    Originally posted by clearpicks
    There is a function setBarBgColor( color [, series] [, yMin] [, yMax] )
    to set the background color between ymax and ymin. However it only works on the bar on which the main is being executed.

    How can I paint the background color between ymin and ymax for some old bars. For example, on 60min chart, I would like to calculate the overnight high and low (denoted as OH and OL) and paint the background of the overnight bars between OH and OL to lightgrey. Because OH and OL are finalized only when all overnight bars have been processed, therefore it seems I have to use setBar(Bar.BgColor, barindex, value) to set the background color of old bars. However setBar does not accept ymax and ymin as the y-axis parameters. If I don't want the script being self-reloaded once so that it can calculate OH and OL in the first run and paint the background in the second run, is there existing efs function similar to setBarBgColor( color [, series] [, yMin] [, yMax] ) but working on older bars?

    - Clearpicks

    Comment

    Working...
    X