Announcement

Collapse
No announcement yet.

Dynamic Paint Price Bars

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

  • Dynamic Paint Price Bars

    Hi,
    Is it possible to turn off/on the PriceBarColor?

    If yes, can anybody tell me what I am doing wrong?
    Belowis the code I am trying.
    Thank you.


    function main(Show64CH, ShowPaint, PaintBackground, ShowSignals){

    if(ShowPaint == null) {ShowPaint = 0;}
    if(Show64CH == null) { Show64CH = 0;}
    if(PaintBackground == null) { PaintBackground = 0;}
    if(ShowSignals == null) { ShowSignals = 0;}

    .......................

    //{{PAINT PRICE BARS

    if (ShowPaint > 0){
    setColorPriceBars(true);
    if (Strategy.isLong() == 1) {setPriceBarColor(Color.lime);}
    else if (Strategy.isShort() == 1) {setPriceBarColor(Color.red);}
    else {setPriceBarColor(Color.lightgrey);}
    } else {setColorPriceBars(false);}
    Mihai Buta

  • #2
    mbuta,

    I tested this and discovered that setColorPriceBars() is not designed to be turned on and off on a per bar basis.

    Could you specify what the desired result is? Did you want all bars' coloring to be shut off under certain conditions?
    Regards,
    Jay F.
    Product Manager
    _____________________________________
    Have a suggestion to improve our products?
    Click Support --> Request a Feature in eSignal 11

    Comment


    • #3
      I reread your code, and see that you are checking against an input parameter. This should work fine as this would remain a constant throughout the life of the study.
      Regards,
      Jay F.
      Product Manager
      _____________________________________
      Have a suggestion to improve our products?
      Click Support --> Request a Feature in eSignal 11

      Comment


      • #4
        Hi,

        Yes is not "designed" to be turned on/off.

        I circumvent the problem by painting the bars for the zero setting based on close > or < than open, like they do it.

        Thanks,
        Mihai
        Mihai Buta

        Comment

        Working...
        X