Announcement

Collapse
No announcement yet.

Inconsistent setPriceBarColor behavior

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

  • Inconsistent setPriceBarColor behavior

    Hi,

    I get inconsistent behavior when turning on/off the colors for price bars, based on an input parameter "PaintPriceBars".
    Sometimes colors the bars, sometimes not.
    Sometimes turns all white if I turn the coloring off.

    I have to remove the efs from chart and load again to make it respond properly, until gets stuck in one state or an other again.

    It looks like does not always read the parameters when reloading the efs.

    Is there a known problem there, or I am doing something stupid?

    Note: I check for the parameter in my code, I even tried to use
    setColorPriceBars(true/false) before setPriceBarColor(Color.xxx), but with no better results.

    Thank you.
    M
    Mihai Buta

  • #2
    Mihai
    As far as I have seen that can happen if together with setColorPriceBars() there is no setDefaultPriceBarColor() or if there is no underlying constant condition which is always true (which is the method I tend to use) ie something like if (1==1) setPriceBarColor(Color.xxxx);
    Alex

    Comment


    • #3
      Thanks Alex,

      At least I know that it happens not only to me.
      I ended up tricking the system:
      If I don't want paint, I paint them anyway, like the candlesticks do. Something like the example below:

      if (PaintPriceBars != 0) {
      do my painting
      } else {
      if (close>open) color.lime
      if (close<open) color.red
      }

      It does the jobs.

      Regards,
      M.
      Mihai Buta

      Comment

      Working...
      X