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

Re: [amibroker] Adding data to field in existing symbol database.



PureBytes Links

Trading Reference Links

Herman has very code sample code for using fopen.  its for reading the TWS trade list.  just look it up in amibroker files list.  i haven't looked at it in a while, but its the best i've seen.
 
The limitations of using SQL, as I have experienced are as follows:  if you're using windows mysql, a database size of 0.5gig is probably about the limit before you start having serious problems with chart refreshing.
 
Dummy tickers across 9,500 stocks is a LOT of work.  That doubles ticker sizes at a minimum.  I would shy away from this approach now that I've heard 9,500.
 
Seems best might be either: (a) sql or (b) fopen >> static variable.
 
One more thing I've done with a lot of success also is to use the getnote feature instead of using fopen filename process.  This would work if you are assigning a single value to a ticker that applies for the whole array.
 
based on the fact your data is already in sql, I'd recommend spending about 3-6 hours reading about odbc and v1.4.0 odbc/sql plug-in.  google it: site:www.amibroker.com odbc
 
using mysql, once up and running (thats the key) is fairly straightforward actually.  it only took me a year to figure it out.  now my database is too big and its creeping slow.  but thats another problem unrelated to amibroker.
 
Ken, if you were much more specific on how many data fields and how often the fields are different, I might be able to steer you in either the direction of fopen/filename or mysql approach.  let me know and I can help a bit with this.  sql is where i'm leaning given its much more structured and easier to code - once its up and running (caveat).
 
 
----- Original Message -----
From: Ken Close
Sent: Monday, June 02, 2008 11:49 AM
Subject: RE: [amibroker] Adding data to field in existing symbol database.

Chris: thanks for getting back....replies are below in CAPS:


From: amibroker@xxxxxxxxxps.com [mailto:amibroker@yahoogroups.com] On Behalf Of Chris DePuy
Sent: Monday, June 02, 2008 12:39 PM
To: amibroker@xxxxxxxxxps.com
Subject: Re: [amibroker] Adding data to field in existing symbol database.

Ken, I think you are asking whether you can add information to the Amibroker database that is not related to O,H,L,C,V, OI from a source that is different from Amiquote, right? 
YES, THIS IS WHAT I WANT TO DO.  THE SOURCE WOULD BE AN EXTERNAL CSV FILE OR PERHAPS A TABLE(S) FROM A MYSQL DATABASE. 
 
If so, I'm afraid that ASCII import is probably your best bet.  The way I've done that is to create a dummy ticker like QQQQa and then put information into the O array of QQQQa that relates to, say, bids and information into the H array of QQQQa for, say, asks. 
AT FIRST, I SHY AWAY FROM CREATING A DUMMY TICKER BECAUSE I NEED TO DO MY PROCESS ON A LOT OF SYMBOLS, ALMOST ALL OF THE SYMBOLS IN THE FASTTRACK DATABASE (9500+). BUT MAYBE THIS IS THE ONLY WAY. 
 
Then, in order to operate on this information, one relatively straightforward way is to use the Foreign command, like Foreign ("QQQQa","O") when you need to retrieve bids.  Or you could have amibroker retrieve these fields on demand (in your code) using fopen commands from a .csv format.  or you could retrieve from ..csv and put into static variables.  Or you could use the sql retrieval process made available by Amibroker. 
NOW ALL OF THESE APPROACHES ARE SEPARATE FROM THE ASCII IMPORT THAT YOU SAID "IS PROBABLY MY BEST BET".  I NEED TO RETRIEVE THE KEY PARAMETER I WANT TO SAVE FOR EVERY SYMBOL FOR EVERY DATE THERE IS A QUANTITY AVAILABLE (MONTHLY DATA) BECAUSE THAT QUANTITY WILL BECOME A RANKING VARIABLE FOR BACKTESTING PURPOSES, PROBABLY USING IT, IN SOME MODIFIED FORM, AS THE POSITIONSCORE FOR A ROTATIONAL BACKTEST.
 
CAN YOU SHARE (OR EMAIL ME DIRECTLY) SOME SAMPLE CODE FOR THE RETRIEVAL PART USING FOPEN. THE SQL RETRIEVAL PROCESS IS ALSO VERY INTERESTING BECAUSE THE RANKING VARIABLE I WANT TO USE IS NOW ENSCONCED IN MYSQL DATA TABLES, ONE TABLE FOR EACH DATE (MONTHLY) THAT THE RANKING PARAMETER WAS CREATED FOR.
 
THIS WOULD HELP ME TREMENDOUSLY IN UNDERSTANDING THE STEPS AND FORMATS NEEDED FOR THE CODE FOR SUCH OPERATIONS.  EXAMPLES I HAVE FOUND IN HELP FILES AND OTHER MESSAGES ARE JUST TOO SPARSE OR NOT RELEVANT FOR LEARNING ABOUT MY PROBLEM (RECENT EXAMPLE SUGGESTED IN MSG 121755 BEING A NOTABLE EXCEPTION).
 
MANY THANKS.
KEN 
 
Personally, I've done all four of these with success.  Each has their place.  But, before I go any further, perhaps you could confirm that this is what you are trying to accomplish....
 
 
----- Original Message -----
From: Ken Close
Sent: Monday, June 02, 2008 9:19 AM
Subject: RE: [amibroker] Adding data to field in existing symbol database.

Well, thanks, but I need to add many symbols read automatically from a spreadsheet file into the database. The Quote Editor will not do it automatically as far as I know.
Ken


From: amibroker@xxxxxxxxxps.com [mailto:amibroker@yahoogroups.com] On Behalf Of Jindrich Kostalek
Sent: Monday, June 02, 2008 11:04 AM
To: amibroker@xxxxxxxxxps.com
Subject: RE: [amibroker] Adding data to field in existing symbol database.

Have a look at Symbol > Quote Editor ?

Henry

From: amibroker@xxxxxxxxxps.com [mailto:amibroker@yahoogroups.com] On Behalf Of Ken Close
Sent: Monday, June 02, 2008 4:37 PM
To: amibroker@xxxxxxxxxps.com
Subject: [amibroker] Adding data to field in existing symbol database.

Amiquote and Import from ASQII are both aimed towards helping people import quotes from services like Yahoo.

No where that I can find does the Help file (or the Knowledgebase, or the Users Knowledgebase, nor past archived messages) talk about how to ADD a value to an existing field (say an empty volume or OI field) in an existing database.

Experimenting with the above mentioned tools does not produce the result I need.

I have nowhere else to turn as all of the above resources are silent.

As someone else said: "can someone toss me a bone" on this subject.

Thanks for any help.

Ken

__._,_.___

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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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




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

__,_._,___