Announcement

Collapse
No announcement yet.

Improvement on "more paint bars"

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

  • Improvement on "more paint bars"

    Alexis
    What would be more useful to read as opposed to the dots would be as follows:
    The requirements(ie formula) would be exactly as before but the bar to be painted lime green would be the bar two bars to the right of the lime green dot and the bar to be painted red would be two bars to the right of the red dot.

    I hope this makes sense..sorry to mess you about!
    David

  • #2
    David
    The enclosed revision paints the current bar in which the conditions are true.
    Alex


    PHP Code:
    function preMain() {
    setPriceStudy(true);
    setStudyTitle("Paintbar2"); 
    setShowCursorLabel(false);
    setColorPriceBars(true);
    setDefaultPriceBarColor(Color.black);
    }

    function 
    main() {

    if(
    high(-2)>high(-3)&&high(-2)>high(-4)&&high(-2)>high(-5)&&high(-2)>high(-6)&&
       
    high(-2)>high(-1)&&high(-2)>high()){
           
    setPriceBarColor(Color.red);
    }
    if(
    low(-2)<low(-3)&&low(-2)<low(-4)&&low(-2)<low(-5)&&low(-2)<low(-6)&&
       
    low(-2)<low(-1)&&low(-2)<low()){
           
    setPriceBarColor(Color.lime);
    }

    return;

    Comment

    Working...
    X