PureBytes Links
Trading Reference Links
|
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: amibroker@xxxxxxxxxxxxxxx
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
Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.17.35/680 - Release Date: 2/10/2007 9:15 PM
|