[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Vertical Grid Line



PureBytes Links

Trading Reference Links




I have created a small routine to make the appropriate changes for the 
upcoming summer time changes in US and Australian eastern states (no time 
changes where I live, but the ASX market is in east states). I believe the US 
and Aust change on the same date again so the changes only need to be done once. 
I use quotetracker for intraday data and this arrives as US EST (ESST) so in my 
summer the time shift is +16 hours and in winter +14 hours. Previously I used to 
export the data to excel and change the times there which was laborious and 
boring. Now the improvements in AB make this simple and easy.Btw if you do 
not make the mods to the historical intraday data the times will not be 
consistent throughout your data.Here is the instructions and code, hope this 
helps someone
/*
CHANGING ALL DATA FOR SUMMER TIME CHANGES
Datafeed through QT is in US EST which changes with the seasons 
daylight saving. About the same time (if lucky on same weekend) Australian 
eastern states change summer time (in reverse). So we have in Aust summer time 
shift +16 hours AND in winter +14 hours
To change the times for summer timezone changes US & 
Australian for the historical saved data in Amibroker I use the 
following:-
For Export:
Databse Settings - Intraday Settings -
In March - change the time shift to +2 hrs to adjust for winter 
time 
In November - change the time shift to -2 hrs to adjust for 
summer time (Nov)
Export intraday and EOD data to TXT files 
One file for each stock
In the first line insert the directory you want to save them to, 
make sure the directory exists
Select your charts to export with the "Apply to" filter in AA 
window 
Select the timeframe period you want to save as using the AA 
"Settings"
Press Scan button
The data is now saved to txt files with US times adjusted for 
the next timezone season.
To Create the new database for new season
Remove all data from the existing database (or create new 
one)
Make the time shift in Database Settings - Intraday Settings to 
0 (zero)
Import the adjusted data with the import wizard. 
Now ready to rock and roll
Oh sometimes the US and Aust do not change summer time on same 
weekend and this needs to be done twice with 1 hour adjustment each time 
:(

by Graham Kavanagh 05 Mar 2004
*/
fh = fopen( <FONT 
color=#ff00ff>"c:\\SaveData\\"+Name()+<FONT 
color=#ff00ff>".txt", "w"); <FONT 
color=#800000>
if( fh ) 
{ 
fputs( <FONT 
color=#ff00ff>"Ticker,Date,Time,Open,High,Low,Close,Volume \n", fh ); 

y = Year(); 
m = Month(); 
d = Day(); 
r = Hour();
e = Minute();
n = Second();

for( i = 0; i 
< BarCount; i++ ) 
{ 
fputs( Name() + <FONT 
color=#ff00ff>"," , fh );
ds = StrFormat(<FONT 
color=#ff00ff>"%02.0f-%02.0f-%02.0f,", 
y[ i ], m[ i ], d[ i ] ); 
fputs( ds, fh ); 

ts = StrFormat(<FONT 
color=#ff00ff>"%02.0f:%02.0f:%02.0f,", 
r[ i ],e[ i ],n[ i ] ); 
fputs( ts, fh ); 
qs = StrFormat(<FONT 
color=#ff00ff>"%.4f,%.4f,%.4f,%.4f,%.0f\n", 
O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] ); 
fputs( qs, fh ); 
} 
fclose( fh ); 
} 
Buy = 0<FONT 
size=3>;
Cheers,Graham<A 
href="">http://e-wire.net.au/~eb_kavan/ 



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html








Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.