Loading ...
Sorry, an error occurred while loading the content.

Re: [amibroker-ts] Weekly prices in daily analysis...

Expand Messages
  • Anthony Faragasso
    weekstart = DayOfWeek() Ref( DayOfWeek(),1); /**Establish Weekly Price arrays**/
    Message 1 of 4 , Sep 3, 2003
    View Source
    • 0 Attachment
      weekstart = DayOfWeek() < Ref( DayOfWeek(), -1 );

      weekend = DayOfWeek() > Ref( DayOfWeek(),1);

      /**Establish Weekly Price arrays**/

      WeeklyOpen=ValueWhen(DayOfWeek()< Ref(DayOfWeek(),-1) ,Open);

      WeeklyHigh = ValueWhen( weekend, HighestSince( weekstart, High ) );

      WeeklyLow = ValueWhen( weekend, LowestSince( weekstart, Low ) );

      WeeklyClose=ValueWhen(DayOfWeek() > Ref( DayOfWeek(),1),Close);


      ---
      Outgoing mail is certified Virus Free.
      Checked by AVG anti-virus system (http://www.grisoft.com).
      Version: 6.0.514 / Virus Database: 312 - Release Date: 8/28/2003
    • jtelang
      That gets me what I want. Thanks. Although not important, still puzzled why mine didn t work though. Jitu
      Message 2 of 4 , Sep 3, 2003
      View Source
      • 0 Attachment
        That gets me what I want. Thanks.

        Although not important, still puzzled why mine didn't work though.

        Jitu

        --- In amibroker-ts@yahoogroups.com, "Anthony Faragasso"
        <ajf1111@e...> wrote:
        > weekstart = DayOfWeek() < Ref( DayOfWeek(), -1 );
        >
        > weekend = DayOfWeek() > Ref( DayOfWeek(),1);
        >
        > /**Establish Weekly Price arrays**/
        >
        > WeeklyOpen=ValueWhen(DayOfWeek()< Ref(DayOfWeek(),-1) ,Open);
        >
        > WeeklyHigh = ValueWhen( weekend, HighestSince( weekstart, High ) );
        >
        > WeeklyLow = ValueWhen( weekend, LowestSince( weekstart, Low ) );
        >
        > WeeklyClose=ValueWhen(DayOfWeek() > Ref( DayOfWeek(),1),Close);
        >
        >
        > ---
        > Outgoing mail is certified Virus Free.
        > Checked by AVG anti-virus system (http://www.grisoft.com).
        > Version: 6.0.514 / Virus Database: 312 - Release Date: 8/28/2003
      • Tomasz Janeczko
        Hello, Just use Amibroker 4.41 and new timeframe functions: wo = TimeFrameGetPrice( O , inWeekly, 0, expandPoint ); wh = TimeFrameGetPrice( H , inWeekly, 0,
        Message 3 of 4 , Sep 4, 2003
        View Source
        • 0 Attachment
          Hello,

          Just use Amibroker 4.41 and new timeframe functions:

          wo = TimeFrameGetPrice( "O", inWeekly, 0, expandPoint );
          wh = TimeFrameGetPrice( "H", inWeekly, 0, expandPoint );
          wl = TimeFrameGetPrice( "L", inWeekly, 0, expandPoint );
          wc = TimeFrameGetPrice( "C", inWeekly, 0, expandPoint );
          PlotOHLC( wo, wh, wl, wc, "Weekly Close", colorWhite, styleCandle );
          Plot( Close, "Daily Close", colorBlue );

          Hope this helps.

          Best regards,
          Tomasz Janeczko
          amibroker.com
          ----- Original Message -----
          From: "jtelang" <jtelang@...>
          To: <amibroker-ts@yahoogroups.com>
          Sent: Thursday, September 04, 2003 1:29 AM
          Subject: [amibroker-ts] Weekly prices in daily analysis...


          > I'm hoping someone could point out what I'm doing wrong here. I'm
          > trying to keep track of weekly OHLC, and grab only the ones when week
          > ends in my daily analysis. So I wrote following to check how it would
          > work, and am puzzled at the results. The tracking HHV and LLV of the
          > week (using Max and Min below) seems to break down exactly 2 bars
          > from start of the week.
          >
          > Any ideas?
          >
          > Thanks.
          >
          > Jitu
          >
          > ----------------
          > wopen = O;
          > whigh = H;
          > wlow = L;
          > wclose = C;
          >
          > dow = DayOfWeek();
          > wstart = IIf(dow < Ref(dow, -1), True, False);
          > wend = IIf(dow > Ref(dow, 1), True, False);
          >
          > wopen = IIf(wstart, O, Ref(wopen, -1));
          > whigh = IIf(wstart, H, Max(Ref(whigh, -1), H));
          > wlow = IIf(wstart, L, Min(Ref(wlow, -1), L));
          > wclose = C;
          >
          > PlotOHLC(wopen, whigh, wlow, wclose, "Weekly", IIf(wend, colorYellow,
          > colorBlue), styleBar);
          >
          >
          >
          >
          >
          > To unsubscribe from this group, send an email to:
          > amibroker-ts-unsubscribe@yahoogroups.com
          >
          >
          >
          > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
          >
          >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.