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

RE: [amibroker] Database specification - command line? xx.js listing



PureBytes Links

Trading Reference Links


How does one use this xx.js Java script?

Does anything else besides the path to database and
ticker symbol need customizing to open a different database?


Joseph Biran
____________________________________________


-----Original Message-----
From: Marek Chlopek [mailto:mchlopek@xxxxxxx] 
Sent: Wednesday, March 23, 2005 8:28 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Database specification - command line? xx.js
listing


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 --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/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/