Announcement

Collapse
No announcement yet.

setBarBgColor()

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • setBarBgColor()

    When using the setBarBgColor() and setBar( Bar.BgColor,...) (which I assume are the same functions) I find that if I paint just 1 bar's background a different color then the background appears to be between 2 bars. Is this by design? Is there a way I can get it to paint the background of a bar and not be between 2 bars?
    Standing on the shoulders of giants.

  • #2
    wildfiction
    setBarBgColor() and setBar(Bar.BgColor) perform the same function albeit on different bars. The former is used to paint the current bar's background while the latter is used to paint an historical bar's background.
    As far as I can remember both functions have always painted the space between the centerline of a bar and that of the bar that follows. I think this is because the centerline is used for the data points.
    To answer your question I am not aware of an option to paint the background of the bar itself at this time.
    Alex

    PHP Code:
    function preMain(){
        
    setPriceStudy(true);
        
    setShowCursorLabel(false);
    }
     
    function 
    main(){
     
        if(
    getCurrentBarIndex()==-1) {
            
    setBarBgColor(Color.yellow);
            
    setBar(Bar.BgColor,-5,0,Color.lime);
        }
        
        return;

    Comment


    • #3
      Thanks Alexis
      Standing on the shoulders of giants.

      Comment


      • #4
        wildfiction
        You are most welcome
        Alex

        Comment

        Working...
        X