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

RE: [amibroker] DataLocalMode


  • Date: Mon, 15 Mar 2010 16:01:23 -0700
  • From: "ta" <tagroups@xxxxxxxxxxxxx>
  • Subject: RE: [amibroker] DataLocalMode

PureBytes Links

Trading Reference Links



TJ

 

If you get a chance would you please let me know what I am doing wrong? TIA

 

From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of ta
Sent: Tuesday, March 09, 2010 11:34 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] DataLocalMode

 

 

I am trying to programmatically change the “Use only local database” from “yes” to “no” for all the tickers in my database. Reading the manual, I saw “Stock” has a property called DataLocalMode. I am assuming that it takes on value 0 for no and 1 for yes. I modified one of TJ jscript codes to achieve my objective as shown below. It is supposed to read from text file that contains the tickers followed by a comma and a 0 (e.g. IBM,0). However, I am not successful. Do you see the problem with my code? TIA

 

var filename = "c:\\amibroker\\List3.txt";

var fso, f, r;

var ForReading = 1;

var AmiBroker;

var fields;

var stock;

 

/* Create AmiBroker app object */

AB = new ActiveXObject("Broker.Application");

AB.LoadDatabase("c:\\Amibroker\\Data1Min");

 

AB.Visible = true;

 

/* ... and file system object */

fso = new ActiveXObject( "Scripting.FileSystemObject" );

 

/* open ASCII file */

f = fso.OpenTextFile( filename, ForReading);

 

/* read the file line by line */

while ( !f.AtEndOfStream )

{

r = f.ReadLine();

 

/* split the lines using comma as a separator */

fields = r.split(",");

 

/* add a ticker - this is safe operation, in case that */

/* ticker already exists, AmiBroker returns existing one */

stock = AB.Stocks.Add( fields[ 0 ] );

stock.DataLocalMode = fields[ 1 ];

}

/* refresh ticker list and windows */

AB.RefreshAll();

WScript.echo("Local Mode Assignment Completed");



__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___