Announcement

Collapse
No announcement yet.

Average Movement for 5 days

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

  • Average Movement for 5 days

    Is there an EFS file out there that would take the (High – Low) of the past 5 days and divided by 5 to see average movement?

    Example:

    ...............Day1........Day2........Day3....... .Day4........Day5
    High.........20............21............22....... .....23............24
    -
    Low.........19.50.......20.............21.50...... .22............23.50
    ------------------------------------------------------------------------
    ................0.5...+.....1......+.......0.5.... .+....1.....+.......0.5....=...3.5

    3.5 divided by 5 = 0.7

    It would return 0.7 (Which is the average movement for the past 5 days).

    Thank you

    Keto
    Last edited by ketoma21; 05-20-2004, 08:04 PM.

  • #2
    Keto
    The attached efs should do what you asked.
    FWIW another way of achieving the same result would have been to use the Formula Wizard and create a study with two moving averages one for the High and one for the Low both with a length of 5. At that point in the return you would simply subtract the MA of the Low from that of the High.
    Alex

    Attached Files

    Comment


    • #3
      Thank you very much Alexis

      that's what I was looking for the only PROBLEM I need to put it on a 60 min chart by using this code it's going to look at 5 bars back not 5 days back. So, some how I need to find day high and Low of the past 5 days.

      Comment


      • #4
        Keto
        In that case I would suggest checking out Chris Kryza's AverageDailyRangeBands.efs which is available here
        Alex

        Comment


        • #5
          Thank you very much that is what I need

          I'm adding this to the code but why it does not work in REALTIME

          I want it to compute in realtime during the day High - Low

          the EFS getTodayOHLC.efs being called comes with esignal


          function preMain() {

          setPriceStudy(false);
          setStudyTitle("High-Low");
          }

          function main( ) {
          var tHigh;
          var tLow;
          var tRange;

          tHigh = call("getTodayOHLC.efs", "High");
          tLow = call("getTodayOHLC.efs", "Low");
          tRange = tHigh-tLow;

          return tRange;
          }
          Last edited by ketoma21; 05-21-2004, 10:55 AM.

          Comment

          Working...
          X