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

Re: [amibroker] DataLocalMode


  • Date: Tue, 16 Mar 2010 00:33:35 +0100
  • From: Tomasz Janeczko <groups@xxxxxxxxxxxxx>
  • Subject: Re: [amibroker] DataLocalMode

PureBytes Links

Trading Reference Links



Hello,

DataLocalMode controls if *external* data (from plugin) should be also cached locally or not.

Best regards,
Tomasz Janeczko
amibroker.com

On 2010-03-16 00:18, ta wrote:

Thanks for the quick reply. What is DataLocalMode?

 

From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Tomasz Janeczko
Sent: Monday, March 15, 2010 4:16 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] DataLocalMode

 

 

Hello,

Correct property name is not DataLocalMode, but DataSource.
See:

http://www.amibroker.com/kb/2006/09/01/how-to-change-property-for-multiple-symbols-at-once/

stock.DataSource = 1; // turn on "use only local database for this symbol"

Best regards,
Tomasz Janeczko
amibroker.com

On 2010-03-16 00:01, ta wrote:

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

__,_._,___