How to Import data into multiple database at the same time

#1
Dear Gurus,

I have two databases one is for EQ-EOD and another one for FnO-EOD. As I understand, before import we need to select the appropriate database then download. But my question here is, Can we download the EOD data into multiple databases at the same time.

Which mean, i would like to use a Javascript to import data into both EQ_EOD and FnO_EOD without changing the databases.

Is there any AFL command available to select the database name?

Please help me.
Thanks,
Siva
 
#2
Which mean, i would like to use a Javascript to import data into both EQ_EOD and FnO_EOD without changing the databases.

Is there any AFL command available to select the database name?

Siva
what do you mean when you say "without changing the databases"?

any way i think i know what you looking for

if you write 2 times the code below, javascript automatic will open, import, save one by one your database
where //**** Need edit write your Path and xxx.format
Code:
    // database path 
var FnOdatabase="E:\\Ami-Data\\FnO_EOD\\";   //**** Need edit

AmiBroker = new ActiveXObject( "Broker.Application" );
     // save current Database before open the new one FnO_EOD Database
AmiBroker.SaveDatabase(); 
     // Open FnO_EOD database
AmiBroker.LoadDatabase (FnOdatabase);

 if( ! AmiBroker.Import( 0, "C:\\temp\\DAX.csv","FnO.format" )); //****  Need edit
 if( ! AmiBroker.Import( 0, "C:\\temp\\EURUSD.csv","FnO.format" ));
AmiBroker.RefreshAll();
AmiBroker.SaveDatabase()
//AmiBroker.Visible(1);  // Open Ami if is closed
 
Last edited:

Similar threads