AFL to write candle high low values to file

iTrade

Well-Known Member
#1
Hi,

I have this AFL which I found on internet few minutes back, and it writes candles OHLC values to a file. I applied the AFL to a chart and it works on a static 1 min chart.

I am very much new to Amibroker, and so I have a question:
Assuming I am using a 1 min chart in Amibroker and getting real time intraday quotes, will this AFL write values for every 1 min candle that closes or will it write value for every tick of 1Min candle?

My need is that I want the OHLC value in a file only immediately after every 1 min candle closes till market closes.

Please help me with this question. I dont want to wait till monday to see how it works.

Here is the AFL:

fh = fopen( "C:\\02_BANK_ALL.csv", "w");
if( fh )
{
fputs( "Symbols,Date,Open,High,Low,Close\n", fh );

m = Month();
d = Day();
y = Year();
for( i = 0; i < BarCount; i++ )
{
qs = StrFormat("%.2f, %.2f, %.2f, %.2f\n",
O[ i ], H[ i ], L[ i ], C[ i ] );
fputs( qs, fh );
}
fclose( fh );
}
 

Similar threads