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 data to file for Amibroker (AFL)

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

This afl exports data to a file for further use…

i found this on web and sharing this here …hope will help..

avdut

Similar Indicators / Formulas

E Ratio
Submitted by olive almost 14 years ago
RAJASWAMY BUY SELL TELLER
Submitted by rajaswamy over 13 years ago
Gradient price
Submitted by vks510 almost 13 years ago
Background symbol Name
Submitted by mkeitel almost 14 years ago
*Level Breakout system*
Submitted by Tinych over 12 years ago

Indicator / Formula

Copy & Paste Friendly
// Press Scan button // // created a directory on your C drive named AmiBroker data backup

dayhours = ParamToggle("Day hours only", "No|Yes");
fmkdir("c:\\AmiBackupD\\");
SetBarsRequired(100000,100000);
lname = Name(); // gets the name of the symbol
// note: if you have names with invalid characters like / you must rename the file before you try to create a Name 
// add an IF line for each symbol you need to rename
if (lname == "ER2U8-GLOBEX-FUT") lname = "ER2U8";

fh = fopen( "c:\\AmiBackupD\\" + lname + ".csv", "w"); 
if( fh ) 
{ 
	if(Interval() == inDaily OR Interval() == inMonthly OR Interval() ==
inWeekly)
	{
		fputs( "Ticker,Date,Open,High,Low,Close,Volume \n", fh ); 
	   	for( i = 0; i < BarCount; i++ ) 
		{ 
 		  	y = Year(); 
 		  	m = Month(); 
		   	d = Day(); 
			fputs( Name() + "," , fh );
   		   	ds = StrFormat("%02.0f-%02.0f-%02.0f,", m[ i ], d[ i ], y[ i ] ); 
   	   		fputs( ds, fh ); 
      		qs = StrFormat("%.4f,%.4f,%.4f,%.4f,%.0f\n", O[ i ],H[ i ],L[ i ],C[ i
],V[ i ] ); 
      		fputs( qs, fh ); 
			if(i == 65500 OR i == 130000 OR i == 196500 OR i == 262000)
			{
				fclose( fh ); 
				if(i == 65500  ) fh = fopen( "c:\\AmiBackupD\\" + lname + " A.csv", "w"); 
				if(i == 130000 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " B.csv", "w"); 
				if(i == 196500 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " C.csv", "w"); 
				if(i == 262000 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " D.csv", "w"); 
			}
		}
	}
	else // intraday so add time field
	{
		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 = 1; i < BarCount; i++ ) 
		{ 
			if (dayhours AND LastValue(TimeNum()) >= 92900 AND LastValue(TimeNum()) <=
161500)
			{ 
				fputs( Name() + "," , fh );
 		     	ds = StrFormat("%02.0f-%02.0f-%02.0f,", m[ i ], d[ i ], y[ 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
			{ 
				fputs( Name() + "," , fh );
 		     	ds = StrFormat("%02.0f-%02.0f-%02.0f,", m[ i ], d[ i ], y[ 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 ); 
			}
			if(i == 65500 OR i == 130000 OR i == 196500 OR i == 262000)
			{
				fclose( fh ); 
				if(i == 65500  ) fh = fopen( "c:\\AmiBackupD\\" + lname + " A.csv", "w"); 
				if(i == 130000 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " B.csv", "w"); 
				if(i == 196500 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " C.csv", "w"); 
				if(i == 262000 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " D.csv", "w"); 
			}
 	  	} 
	}
   	fclose( fh ); 
} 

Buy = 1;

1 comments

1. anilji

This is mind-blowing stuff thanks for the post.
Dear friend , anyone please help me in to add bid,Offer,bidsize and Offersize
I modified like this but not working well , pls help iam beginner :

// Press Scan button // // created a directory on your C drive named AmiBroker data backup

dayhours = ParamToggle("Day hours only", "No|Yes");
fmkdir("c:\\AmiBackupD\\");
SetBarsRequired(100000,100000);
lname = Name(); // gets the name of the symbol
// note: if you have names with invalid characters like / you must rename the file before you try to create a Name 
// add an IF line for each symbol you need to rename
if (lname == "ER2U8-GLOBEX-FUT") lname = "ER2U8";

fh = fopen( "c:\\AmiBackupD\\" + lname + ".csv", "w"); 
if( fh ) 
{ 
	if(Interval() == inDaily OR Interval() == inMonthly OR Interval() ==
inWeekly)
	{
		fputs( "Ticker,Date,Open,High,Low,Close,Volume,Bid,Ask,BidSize,AskSize \n", fh ); 
	   	for( i = 0; i < BarCount; i++ ) 
		{ 
 		  	y = Year(); 
 		  	m = Month(); 
		   	d = Day(); 
			fputs( Name() + "," , fh );
   		   	ds = StrFormat("%02.0f-%02.0f-%02.0f,", m[ i ], d[ i ], y[ i ] ); 
   	   		fputs( ds, fh ); 
      		qs = StrFormat("%.4f,%.4f,%.4f,%.4f,%.4f,%.4f,%.4f,%.4f,%.0f\n", O[ i ],H[ i ],L[ i ],C[ i
],V[ i ],Bid[ i ],Ask[ i ],BidSize[ i ],AskSize[ i ] ); 
      		fputs( qs, fh ); 
			if(i == 65500 OR i == 130000 OR i == 196500 OR i == 262000)
			{
				fclose( fh ); 
				if(i == 65500  ) fh = fopen( "c:\\AmiBackupD\\" + lname + " A.csv", "w"); 
				if(i == 130000 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " B.csv", "w"); 
				if(i == 196500 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " C.csv", "w"); 
				if(i == 262000 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " D.csv", "w"); 
				if(i == 327500 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " A.csv", "w"); 
				if(i == 393000 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " B.csv", "w"); 
				if(i == 458500 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " C.csv", "w"); 
				if(i == 524000 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " D.csv", "w"); 
			}
		}
	}
	else // intraday so add time field
	{
		fputs( "Ticker,Date,Time,Open,High,Low,Close,Volume,Bid,Ask,BidSize,AskSize \n", fh ); 
 	  	y = Year(); 
 	  	m = Month(); 
	   	d = Day(); 
	   	r = Hour();
	   	e = Minute();
	   	n = Second();
   
	   	for( i = 1; i < BarCount; i++ ) 
		{ 
			if (dayhours AND LastValue(TimeNum()) >= 92900 AND LastValue(TimeNum()) <=
161500)
			{ 
				fputs( Name() + "," , fh );
 		     	ds = StrFormat("%02.0f-%02.0f-%02.0f,", m[ i ], d[ i ], y[ 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,%.4f,%.4f,%.4f,%.4f,%.0f\n", O[ i ],H[ i ],L[ i ],C[ i
],V[ i ],,Bid[ i ],Ask[ i ],BidSize[ i ],AskSize[ i ] ); 
		      	fputs( qs, fh ); 
			}
			else
			{ 
				fputs( Name() + "," , fh );
 		     	ds = StrFormat("%02.0f-%02.0f-%02.0f,", m[ i ], d[ i ], y[ 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,%.4f,%.4f,%.4f,%.4f,%.0f\n", O[ i ],H[ i ],L[ i ],C[ i
],V[ i ],Bid[ i ],Ask[ i ],BidSize[ i ],AskSize[ i ] ); 
		      	fputs( qs, fh ); 
			}
			if(i == 65500 OR i == 130000 OR i == 196500 OR i == 262000)
			{
				fclose( fh ); 
				if(i == 65500  ) fh = fopen( "c:\\AmiBackupD\\" + lname + " A.csv", "w"); 
				if(i == 130000 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " B.csv", "w"); 
				if(i == 196500 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " C.csv", "w"); 
				if(i == 262000 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " D.csv", "w"); 
				
				if(i == 327500 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " A.csv", "w"); 
				if(i == 393000 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " B.csv", "w"); 
				if(i == 458500 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " C.csv", "w"); 
				if(i == 524000 ) fh = fopen( "c:\\AmiBackupD\\" + lname + " D.csv", "w"); 
			}
 	  	} 
	}
   	fclose( fh ); 
} 

Buy = 1;

Leave Comment

Please login here to leave a comment.

Back