Announcement

Collapse
No announcement yet.

more paint bars

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

  • more paint bars

    I wish to paint a bar RED when the high of that bar has a higher high than the previous FOUR bars and a higher high than the subsequent TWO bars.

    I also wish to paint a bar LIME GREEN when the low of that bar has a lower low than the previous FOUR bars and a lower low than the subsequent TWO bars

    Hope this is ok..thanks
    David Hudson

  • #2
    David
    efs cannot paint bars retroactively
    Anyhow the enclosed efs will place a dot on the bars that meet the conditions outlined by you.
    Alex



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

    function 
    main() {

    if(
    high(-3)>high(-4)&&high(-3)>high(-5)&&high(-3)>high(-6)&&high(-3)>high(-7)&&
       
    high(-3)>high(-2)&&high(-3)>high(-1)){
           
    drawTextRelative(-3,high(-3),"•",Color.red,null,Text.BOLD|Text.CENTER|Text.BOTTOM,"Arial",14);
    }
    if(
    low(-3)<low(-4)&&low(-3)<low(-5)&&low(-3)<low(-6)&&low(-3)<low(-7)&&
       
    low(-3)<low(-2)&&low(-3)<low(-1)){
           
    drawTextRelative(-3,low(-3),"•",Color.lime,null,Text.BOLD|Text.CENTER|Text.TOP,"Arial",14);
    }

    return;

    Comment

    Working...
    X