i made a minor change: cls = IIf(!tt,ValueWhen(Ref(dtt,1) == -1,C),Null);
I will look at it again later since the close value / highest high value were looking at an interval that is 1 bar out of sinc. Maybe it can be solved beter than I did now, ed ----- Original Message ----- From: Edward Pottasch To: [email protected] Sent: Sunday, February 11, 2007 3:42 PM Subject: Re: [amibroker] How To Get HHV( High, between 09:30 and 10:30 ) Lester, here some code. Have a look, it seems to work. You need to change startTime to 093000 en endTime to 103000 rgds, Ed startTime = 153000; EndTime = 163000; // assign an array tt having a value 1 inside the interval tt = IIf(TimeNum() >= startTime AND TimeNum() <= endTime,1,0); // high within interval htt = IIf(TimeNum() >= startTime AND TimeNum() <= endTime,H,0); // start bar of interval is 1, end bar is -1 dtt = tt - Ref(tt,-1); // calculate the cumulative number of bars inside the interval bs = BarsSince( dtt == 1 ) + 1; // find number of bars at the end of interval bs2 = IIf(dtt == -1,bs,Null); // assign highest high within the interval assigned to rest of day hgh = IIf(!tt,HHV(htt,bs2),Null); // close price at end of interval assigned to rest of day cls = IIf(!tt,ValueWhen(dtt == -1,C),Null); SetChartOptions(0, chartShowDates); Plot(C,"",1,64); Plot(hgh,"high",colorGold,styleLine); Plot(cls,"close",colorLightBlue,styleLine); Ed ----- Original Message ----- From: Lester Vanhoff To: [email protected] Sent: Sunday, February 11, 2007 10:36 AM Subject: [amibroker] How To Get HHV( High, between 09:30 and 10:30 ) I need the following code for intraday data (one-minute database): 1) HHV( High, between 09:30 and 10:30 ); 2) Close (at 10:30); Then I would need to plot those as horizontal lines each day from their start time till the end of the day. Tnx
