Announcement

Collapse
No announcement yet.

High Low efs

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

  • High Low efs

    hello

    Need some help finding an efs that will indicate the High/low for the week/day. I can find plenty that show the high/low for the month, week, day, minute, etc but I would like the ability to show only the weeks/days that I wish. e.g. the last 1 or 2 or 3 weeks. the other efs show a complete history of the high/lows and this tends to make the charts confusing.

    Does anyone know of an efs that shows the highs and lows for the last few days/weeks and also that one can edit the look back period under edit studies?

    Thanks in advance.

    Pogman

  • #2
    Hello Pogman,

    To get the price data you're after you just need to specify the interval and index relative to that interval.

    high(-1, inv("D")); // yesterday's high
    high(-2, inv("D")); // daily high from two days ago
    high(-1, inv("W")); // last week's high
    high(-2, inv("W")); // weekly high two weeks ago

    To create a formula parameter for the look back period (or index), you can use the
    Function Parameter object. You would then replace the -1 and -2 hard coded index values above with your function parameter variable.

    high(nLookBack, inv("D"));
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      high-low efs

      HI Jason

      Thanks for the quick response. I have modified the High-Low.efs at lines 72-76



      if(Lookback == 0){
      var nHigh = high(-1, inv("W")); changed this one
      var nLow = low(-1, inv("W")); changed this one
      } else {
      var nHigh = high(DLookBack, inv("D"));changed this one
      var nLow = low(-Lookback,inv(vInterval));not this one
      }

      return new Array(nHigh,nLow);
      }

      the efs show this weeks high lows with the "previous weeks" high/low over this week, as i wanted. However, it still shows all the complete high low history and I want to be able to see only one or two or three previous high/low. I tried your ...

      high(nLookBack, inv("D"));

      but I can not figure out where to put it and when I try into lines 75 and 76 I keep getting syntax errors and I just can not figure it out. Closer but no cigar.

      Can you point me in the right direction?

      Thanks

      Pogman

      Comment


      • #4
        Pogman
        I think you may be referring to the High-Low efs that I wrote which is posted here. If that is the case you do not actually need to modify the efs as there already is a provision to select the desired interval and to plot the prior High/Low for that interval.
        Load the original efs into the chart and go to Edit Studies. Then insert W for the Interval and 1 for the Lookback. Irrespective of the chart interval the plot will now be that of the prior week's High/Low.
        As to not displaying historical plots see this thread for a ready made and easy to apply solution.
        Alex

        Comment


        • #5
          Hi Alex

          Yes you did write this great efs. I understand that you can change the lookback and the interval and have done so many times. And you were CORRECT with (what I wanted...) limiting the amount of data to view. The little sma efs you showed worked great (and is exactly what I am looking for) and changing the amount of days to see was very easy, thanks, but as to adding your 2 lines to do what I am after appears to be very difficult for me. I keep getting syntax errors after attempting those two lines.

          This line "var myLib = addLibrary("sampleFunctions.efsLib");//this calls the library" I have tried to put it into the high-low.efs at lines 24 and 54 and in either case it returns syntax error.

          This line "if(myLib.hidePrevDays(2)) return;//this calls the function in the library and passes the parameter" I have tried to put it into the efs at lines 78 and lines 81 and in either cases they do not work.

          I assume that the first line has to go into the function preMain and the other line has to be added to the funtion main, but where? Can you suggest where?

          thanks in advance

          Pogman

          Comment


          • #6
            Pogman
            The call var myLib = addLibrary("sampleFunctions.efsLib"); needs to be placed outside of either function main or function preMain. (see the last example in the thread I indicated where it is added in between main and preMain).
            As to if(myLib.hidePrevDays(2)) return; you can place that in the first line of function main.
            Also did you download the samplefunctions.efsLib attachment and save it to the FunctionLibrary folder in eSignal?
            Alex

            Comment


            • #7
              Hi Alex

              thanks to your help I got it working perfectly with only a few weeks of data rather than the whole chart. There is no way that I could have done it without you. A suggestion would be that all EFS2 or other efs need to have those simple 2 lines of code that you suggest that way a person can modify whatever to their whims.

              I also want to recognize all the assistance that you wonderfully provide to others. You are a wonderful beacon of light to those of us who have endless questions and little answers or insights.

              Thanks again and please keep up the great work

              Pogman
              Attached Files

              Comment


              • #8
                Pogman
                You are most welcome and thank you for the very generous compliments.
                Alex

                Comment

                Working...
                X