[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Database specification - command line?



PureBytes Links

Trading Reference Links

On Wednesday, 23 of March 2005 17:20, ddpn wrote:
> That's what I do already, Mike.  I'm just looking for a way to specify the
> db... externally.

So it might be like this (xx.js):
NOTE that I have no experience in windows scripts nor have not chacked this 
code.

=========
/* GB: The path to database */
DataDir  = "G:\\Amibroker\\Data\\Parkiet_EOD";
/* GB: The ticker to check */
ChkTicker = "TPS";

/* Create AmiBroker app object */
AmiBroker = new ActiveXObject( "Broker.Application" );
/* ... and file system object */
FileSys = new ActiveXObject( "Scripting.FileSystemObject" );
WshShell = new ActiveXObject( "WScript.Shell" );

function IsValidDatabase()
{
	AmiBroker.SaveDatabase( );
	AmiBroker.LoadDatabase( DataDir );
	if( AmiBroker.Stocks.Count > 0 )
	{
		try
		{
			return AmiBroker.Stocks( ChkTicker ).Ticker == ChkTicker;
		}
		catch( e )
		{
			WScript.echo("The database currently loaded into AmiBroker does not have " 
+ ChkTicker + "\nSo I guess this is not correct database.\nUpdate failed.");
		}
	}
	return false;
}

function Main()
{
	bOK = true;
	if( ! IsValidDatabase() ) return;
}

Main();
============


-- 
Marek Chlopek
mchlopek@xxxxxxx


------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/