How do i export last candle Open,High,Low,Close,Volume for selected IEOD time frame


Guide me..
Thank you in advance.

Kindly check the KB / Manual before posting.

Everything is explained with examples and code.

In Automatic Analysis window select Apply to: All Stocks , Range: All quotations (or any other time range or filter, depending on what you need to export)



thank you for your prompt reply, export is fulfill my requirement, but i want only last candle details only to be export in output file.

Guide me how do i do, by define same in ALF file

I have mentioned in Bold. It is there in the article. You have to read it properly. Not just browsing.

Maybe consider using the word "Please"!


thank you, once again.

for ( i = (BarCount-1); i < BarCount; i++ )

How about using forum search in addition?
There have been posted tons of examples on how to (auto-)export to file already.
There have been posted tons on examples on how to export any set analysis range.

The clue is to use Status( "barinrange" ).

I re-post the code here only because interval info has been output to wrong column (-> didn't fit the header) in the other thread. So here is small fix.

And since you want to export intraday and EOD just few additional adjustments required.

/// simplified code modification by fxshrat posted to issue asked by Night19 been discussed in this thread
/// @link
/// code execution via Analysis - Scan
/// Select date range in Range - n-recent bars OR n-recent days OR From-To of analysis toolbar
/// Set periodicity in Analysis settings 'General' tab
/// Then hit 'Scan' button
dir = "C:\\OHLC\\";

Version( 6.20 );

nm = Name();
dt = DateTime();
datewindow = Status("barinrange");

if ( Status( "action" ) == actionScan ) {
	fmkdir( dir );
	fh = fopen( dir + nm + ".csv", "w" );
	per = "," + Interval(2) + ",";

	if ( fh ) {
		fputs( "<ticker>,<per>,<date>,<open>,<high>,<low>,<close>,<vol>\n", fh);
		if( Interval() < inDaily )
			dt_fmt = "%Y-%m-%d %H:%M:%S,";
			dt_fmt = "%Y-%m-%d,";
		for ( i = 0; i < BarCount; i++ ) {
			// if date range of analysis tool bar
			if ( datewindow[i] ) { 
				ds = DateTimeFormat(dt_fmt, dt[i]);
				qs = StrFormat("%g,%g,%g,%g,%g\n", O[ i ], H[ i ], L[ i ], C[ i ], V[ i ]);
				fputs( nm + per + ds + qs, fh );

		fclose( fh );

	Buy = 0;

And since you want to output last bar only all you have to do is setting Range to 1 recent bars in analysis tool bar

As addition to @TrendSurfer, it might be a good idea if you would avoid your demanding tone.