Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Export intraday and EOD data to TXT files for Amibroker (AFL)

Rating:
3 / 5 (Votes 3)
Tags:
amibroker, miscellaneous

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

Similar Indicators / Formulas

Gradient price
Submitted by vks510 over 7 years ago
E Ratio
Submitted by olive over 8 years ago
export data to file
Submitted by avdutsmailbox about 8 years ago
RAJASWAMY BUY SELL TELLER
Submitted by rajaswamy about 8 years ago
Background symbol Name
Submitted by mkeitel over 8 years ago
*Level Breakout system*
Submitted by Tinych about 7 years ago

Indicator / Formula

Copy & Paste Friendly
/*
Export intraday and EOD data to TXT files 
*/

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();
   index = BarCount - 420;
   if(index > 0)
   {
    for( i = index; 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", 
                     O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] ); 
      fputs( qs, fh ); 
    } 
   }
   else {
    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", 
                     O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] ); 
      fputs( qs, fh ); 
    } 
   }
   fclose( fh ); 
} 

Buy = 0;

3 comments

1. arun.victor

Is there any AFL to import Buy/Sell and TSL signals from Amibroker chart to .csv in real time?

2. arun.victor

This Afl import prices of current candle can some one help me… i want to import prices after completion of previous candle i don’t want to import current(Running) candle price

3. StockJock

This code no longer works. Maybe someone would be kind enough to find out why and re-write the code.

Leave Comment

Please login here to leave a comment.

Back