Announcement

Collapse
No announcement yet.

1.5 and -0.5 of previous bar's range

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

  • 1.5 and -0.5 of previous bar's range

    Hi,
    Have anyone made an efs to mark or show 1.5 times and -0.5 times the previous bar's range ? This would be greatly helpful for taking xtl trades.
    Study should just show two lines above and below from the previous bar.

    Thanks,
    Vijaybhalaji AP

  • #2
    Try this..

    PHP Code:

    /*********************************************************
    Sample code to mark bar ranges.
    **********************************************************/

    var nBarCounter 0;

    function 
    preMain() {
        
    setStudyTitle("BarRange Marker");
        
    setCursorLabelName("BR"0);
        
    setDefaultBarFgColor(Color.blue0);
        
    setDefaultBarThickness(1,0);
            
    }

    function 
    main() {
       
       var 
    vBR high(-1) - low(-1);
       var 
    vBR15High high(-1) + (vBR 1.5);
       var 
    vBR15Low low(-1) - (vBR 1.5);

       var 
    vBR5High high(-1) + (vBR 0.5);
       var 
    vBR5Low low(-1) - (vBR 0.5);

       if (
    getBarState() == BARSTATE_NEWBAR) {
         
    nBarCounter += 1;

        
    drawLineRelative(-1vBR15High ,1,vBR15High PS_SOLID2Color.maroon"15Hline"+nBarCounter);
        
    drawLineRelative(-1vBR15Low ,1,vBR15Low PS_SOLID2Color.maroon"15Lline"+nBarCounter);
       

        
    drawLineRelative(-1vBR5High ,1,vBR5High PS_SOLID2Color.blue"5Hline"+nBarCounter);
        
    drawLineRelative(-1vBR5Low ,1,vBR5Low PS_SOLID2Color.blue"5Lline"+nBarCounter);

      }  
    //  end if new bar
        
    return ""+vBR;

    Last edited by Doji3333; 06-23-2010, 03:26 PM.
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      thanks

      thanks. This is good. But it makes the whole chart messy. can you make it display only the previous bar lines and delete the others?

      Comment

      Working...
      X