Announcement

Collapse
No announcement yet.

draw 52 week horizontal line

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

  • draw 52 week horizontal line

    can you help with the basic syntax to draw horizontal line at the 52 week high using current symbol in price chart?
    i just need a little help in the right direction...
    thanks,
    peter.

  • #2
    Re: draw 52 week horizontal line

    peter
    You can use the upperDonchian() function based on the weekly interval with a lookback of 52 periods to determine the value of the 52 week High eg
    var my52WeekHigh = upperDonchian(52, inv("w"), 0)
    Then use the addBand() function to draw that value as a horizontal line across the chart eg
    addBand(my52WeekHigh, PS_SOLID, 2, Color.blue, "my52weekhigh")
    For the description, syntax and examples on the use of these functions see the corresponding articles in the EFS KnowledgeBase
    Alex


    Originally posted by peterjerome
    can you help with the basic syntax to draw horizontal line at the 52 week high using current symbol in price chart?
    i just need a little help in the right direction...
    thanks,
    peter.

    Comment


    • #3
      Alexis,
      sorry about taking so long time to thank you.
      your suggestion works great.

      originally i was able to draw the line OK using addLineTool but i had no idea on how to calculate the 52week High...
      also i prefer your suggestion to use the "addBand" function.
      thanks Alexis.
      peter.

      Comment


      • #4
        peter
        My pleasure
        Alex


        Originally posted by peterjerome
        Alexis,
        sorry about taking so long time to thank you.
        your suggestion works great.

        originally i was able to draw the line OK using addLineTool but i had no idea on how to calculate the 52week High...
        also i prefer your suggestion to use the "addBand" function.
        thanks Alexis.
        peter.

        Comment


        • #5
          donchian channel study on daily chart

          Donchian Channel study and 52 week High:

          displays 52 week high on weekly chart.
          yearHigh = upperDonchian(52, inv("W"), 0);

          can the study be modified to work on daily chart?
          is this workable?
          yearHigh = upperDonchian(260, inv("D"), 0);
          (52 weeks using 5 days per week).

          peter.

          Comment


          • #6
            Re: donchian channel study on daily chart

            peter

            displays 52 week high on weekly chart.
            yearHigh = upperDonchian(52, inv("W"), 0);
            That will display the 52 week High on a chart of any interval not just the weekly
            Alex


            Originally posted by peterjerome
            Donchian Channel study and 52 week High:

            displays 52 week high on weekly chart.
            yearHigh = upperDonchian(52, inv("W"), 0);

            can the study be modified to work on daily chart?
            is this workable?
            yearHigh = upperDonchian(260, inv("D"), 0);
            (52 weeks using 5 days per week).

            peter.

            Comment


            • #7
              52 week high

              i see that now alexis.
              my confusion came from the 52 W HIGH reported in eSignal quote window.

              eg. FLIR shows 31.48 as 52 week High in quote window...while both the daily & weekly charts show the correct value at 32.19.

              a little over 2% difference. seems reasonable.
              thanks,
              peter.

              Comment


              • #8
                Re: 52 week high

                peter
                Keep in mind that up until yesterday the 52 week High was actually 31.48 and the Quote window is now showing a 52 week High of 32.19. The difference you were seeing may not be due to some data error but to the fact that eSignal may be updating the value only when a new day starts so that all the alerts etc will trigger if a new High is put in place on the current day. The Donchian function as used in your code example instead includes the most recent bar and updates as new Highs occur
                Alex


                Originally posted by peterjerome
                i see that now alexis.
                my confusion came from the 52 W HIGH reported in eSignal quote window.

                eg. FLIR shows 31.48 as 52 week High in quote window...while both the daily & weekly charts show the correct value at 32.19.

                a little over 2% difference. seems reasonable.
                thanks,
                peter.

                Comment

                Working...
                X