ASCII importer in AFL

shanki99

Well-Known Member
#1
I use "Import Ascii" (not the Wizad) from the file menu to import data. I give the File name and also select the Format File.

My query is can this be written inside an AFL so that the entire process is automated??
I mean when I double click that particular AFL, then it shud take the Data File path and the Format type file automatically (as coded in the AFL) and then show me the chart after import process is over.....can this be done??

Ami gurus...Plz help

Rgds
 
Last edited:

vijayanscbe

Well-Known Member
#4
importquotes();

function importquotes()
{
filename = "C:\\Program Files\\AmiBroker\\datadownloader data\\^nsei.txt";
AmiBroker = new ActiveXObject("Broker.Application" );

AmiBroker.Import( 0, filename, "yahoo.format" );
AmiBroker.RefreshAll();
}

{
filename = "C:\\Program Files\\AmiBroker\\datadownloader data\\^nsebank.txt";
AmiBroker = new ActiveXObject("Broker.Application" );

AmiBroker.Import( 0, filename, "yahoo.format" );
AmiBroker.RefreshAll();
}
 

vijayanscbe

Well-Known Member
#5
the above javascript can use to update txt data to amibroker.........

copy the above and paste in a notepad and save as name.js ..............

u should change the file name and .format .............

if u doubl click this file datas would be upload to the amibroker.........

am also in search of auto run of script with some specified time interval ....

any body know pls share it ........

thanks in advance............. :clap:
 

pkgmtnl

Well-Known Member
#6
Can anybody post the link from where these TXT files (for EoD) to import into Amibroker can be downloaded for NSE & BSE?

What I have found that Bhavcopy is in CSV format...!

bye with regrds
 

shanki99

Well-Known Member
#7
the above javascript can use to update txt data to amibroker.........

copy the above and paste in a notepad and save as name.js ..............

u should change the file name and .format .............

if u doubl click this file datas would be upload to the amibroker.........

am also in search of auto run of script with some specified time interval ....

any body know pls share it ........

thanks in advance............. :clap:

Is this the correct way of doing things??

importquotes();

function importquotes()
{
filename = "C:\\Pointer\\Axisbank.csv";
AmiBroker = new ActiveXObject("Broker.Application" );

AmiBroker.Import( 0, Axisbank, "Ventura.format" );
AmiBroker.RefreshAll();
}


Sadly it does not work....dont know whats the problem....plz reply

Thanx
 
Last edited:

vijayanscbe

Well-Known Member
#8
yes its a working javascript am using every day .............

check the file path ..............

ventura.format is correct format??? ................

for 1st time import the txt file through import wizard that time save the ascii with some name i save as yahu.format........

put the correct file name and .format
 

shanki99

Well-Known Member
#9
I cud not attach the sample CSV file...Plz find the image of today' CSV file.
http://img195.imageshack.us/img195/2024/samplecsvfileimage.png

The path where the CSV file is stored is as per the picture...
http://img194.imageshack.us/img194/5323/csvfilepath.png


The Ventura Format file which resides inside Format folder of Amibroker has the following commands
# Format definition file generated automatically
# by AmiBroker's ASCII Import Wizard
$DATE_YMD 2009-10-21
$FORMAT Time, Open, High, Low, Close, Volume
$SKIPLINES 0
$SEPARATOR ", "
$CONT 1
$GROUP 100
$AUTOADD 1
$DEBUG 1
$BREAKONERR 1


Plz have a recheck of the same and let me know why this is not working

Thanx in advance
 

Similar threads