[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


I have seen no answer to my question below so far. 

I am a novice when it comes to scripting especially Java. 
I am assuming that once I create this script xx.js 
just double clicking on it will launch AB with the proper 
database/symbol open. 

Now, all I would like to know is: does anything else except 
the path to database and ticker symbol need customizing?

Do you know the answer?

Regards,
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 checked
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/