Announcement

Collapse
No announcement yet.

Percentage of HigherHighs and LowerLows

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

  • Percentage of HigherHighs and LowerLows

    Does anybody know, how to write an indicator code for this:

    Two Lines in one window:

    - Line 1: Percentage of bars within a period of 100(variable) bars, that made a higher high than the previous bar
    -Line 2: Percentage of bars within a period of 100(variable) bars, that made a lower low than the previous bar

    Thanks

  • #2
    muecke
    I think the attached efs does what you asked.
    It will count the bars with a higher high or lower low than the prior bar over a user defined period and plots the totals as two lines. Inside and outside bars are not counted.
    The lookback period is set to 100 as default and can be modified through Edit Studies.
    Alex

    Attached Files

    Comment


    • #3
      Great!

      Thank you very much!

      saluti!

      Comment


      • #4
        muecke
        You are most welcome.
        As of now the efs plots the simple counts which are the same as a percentage if using 100 as the Lookback period. If instead you prefer to see the count expressed as a percentage then add the following after line 58 of the efs
        var PercUp = (nSumUp/Lookback)*100;
        var PercDn = (nSumDn/Lookback)*100;

        and replace
        return new Array (nSumUp,nSumDn);
        with
        return new Array (PercUp,PercDn);
        Saluti anche a te
        Alex

        Comment


        • #5
          Ciao,

          Thanks again,
          unfortunately that gives me a Syntax Error.....

          Obviously I am inserting it wrongly. I am absolutly unfamilar with the ESignal-Program-Language.

          By the way, is there a way to smooth this indicator?

          looking forward to your response....

          Andrea

          Comment


          • #6
            Andrea
            The attached revision of the efs plots the counts as percentages.
            As to smoothing the plots the only way I can think of is through a moving average although that seems to defeat the purpose of the efs in some ways.
            Alex
            Attached Files

            Comment


            • #7
              Perfect,

              thanks again.

              You are right, smoothing does not make much sense. It's more about finding out how to interpret the horizontal levels.

              Anyway, I will let you know, whether it helped to make the 2nd million.....
              and reward you appropriately

              Saluti
              Last edited by muecke; 02-11-2004, 05:39 AM.

              Comment

              Working...
              X