Announcement

Collapse
No announcement yet.

setStudyBgColor??

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

  • setStudyBgColor??

    I have been using colors as a way to more quickly see multiple bullish or bearish indicator (study) conditions, but I'm getting color overload.

    For example, I've got red or green BarBg colors for MACD and RSI above or below 0, and red or green ChartBg colors when stochastics crosses up thru 20 or down thru 80. And with charts in a few timeframes side by side, it all starts to look like endless candy canes after a while.

    Is there such a thing as a setStudyBgColor command, so when MACD > 0 just the (entire) MACD study background changes color (not the entire chart background color), so I don't have the series of red and green BarBg color bands from previous crossings above/below 0?

    I seem to recall there was a way to repaint previous BarBG colors? So if MACD crossed above 0, all MACD barBg colors would become green. If that is the only way to achieve this, what was the command for repainting past bars?

    Thanks
    shaeffer

  • #2
    shaeffer

    Is there such a thing as a setStudyBgColor command

    No there is not. You may want to send a suggestion to [email protected]

    what was the command for repainting past bars?

    setBar()
    Click here for more information on this function
    Alex

    Comment


    • #3
      Hi Alex,

      I've made the suggestion to "Ideas"

      I tried the setBar() command. The problem though is the BarOffset variable can only be a single value (I think?). It won't change the Bg color of all previous bars. I copied the command 10 times to change the previous 10 bars, and it makes the condition (color) change more obvious. I could copy the command 120 times so all viewable bars change colors, but that seems extreme.

      Is there a way to input a range for BarOffset, or some other way to change the entire study background color?

      Regards
      shaeffer

      Comment


      • #4
        shaeffer
        See the example in the efs in this post. Comments are in the script.
        Alex

        Comment


        • #5
          Once again you had the answer Alex.

          I often change the width of a chart during the day. But as "var vCntr =getNumBars" is underneath function main, I'm assuming my efs will recognize the new chart width.

          Thanks,
          shaeffer

          Comment


          • #6
            shaeffer
            getNumBars() returns the number of bars loaded in the chart irrespective of whether they are in the displayed portion or not. Do consider that if you have a lot of bars loaded in the chart the routine could get processor intensive as you are repainting every single historical bar so you may want to consider replacing getNumbers() with a fixed value
            Alex

            Comment

            Working...
            X