Export von Daten (intraday, EOD usw) mit Amibroker. AFL Datei im Zip Archiv unter C:\...\AmiBroker\Formulas\Custom ablegen.
Erklärung steht im Code. Wer eine Übersetzung benötigt, melden.
Erklärung steht im Code. Wer eine Übersetzung benötigt, melden.
Quellcode
- /*
- Export intraday and EOD data and Weekly and ... 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 "Range".
- Select the timeframe period you want to save as using the AA "Settings". AA = "Auto Analysis"
- Press Scan button. File(s) is/are saved.
- by Graham Kavanagh 05 Feb 2004
- */
- fh = fopen( "c:\\SaveData\\"+Name()+".txt", "w");
- if( fh )
- {
- fputs( "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() + "," , fh );
- ds = StrFormat("%02.0f-%02.0f-%02.0f,",
- y[ i ], m[ i ], d[ i ] );
- fputs( ds, fh );
- ts = StrFormat("%02.0f:%02.0f:%02.0f,",
- r[ i ],e[ i ],n[ i ] );
- fputs( ts, fh );
- qs = StrFormat("%.4f,%.4f,%.4f,%.4f,%.0f\n", //Choose amount of decimal places for each quote, e.g. by changing %.4f to %.2f. Now quotes have 2 decimal places instead of 4.
- O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] );
- fputs( qs, fh );
- }
- fclose( fh );
- }
- Buy = 0;
"I'm a trader, baby. So, why don't you kill me?!"