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

[amibroker] RE: CSI-UA export to AB (daily update time and steps)



PureBytes Links

Trading Reference Links

Dave (and others interested in CSI-UA data):

Here is some more info on how I handle UA data in AB.

TWO DATABASES (HIGHLY RECOMMENED IN MY OPINION):

I create 2 databases of CSI data in AB: one large one for
"research" and a smaller one for "trading". 

Both have the same number of stocks. The difference is the
number of bars for each stock (about 3,500 bars for the
research data base, and 250 bars for the trading one).

I use UA's new "direct to AB" export to create and update a
“trading” database of CSI data with 250 bars/stock.
That is more than enough for my trading purposes. It is
much faster to export 250 bars (1 year) than 3500 (13 years
or so). Also things go a lot faster in AB when scanning to
get stock picks. The entire database of just 250 bars/stock
will easily be cached in RAM (either by AB itself, or if
AB’s cache limit is set low, then Windows will cache the
files as they come from the hard drive). Either way, any
repeat scans are very fast and the initial read from the
hard disk is faster too since the files are far smaller. 

WHAT HAPPENS IF THERE IS A STOCK SPLIT? 

UA documentation says UA will export the full history for
that stock. I assume "full" history is defined by the
number of bars in the Distribution3, "Export history..."
option in the Perferences/Account menu.

WHAT HAPPENS IF CSI CORRECTS A PRICE THREE MONTHS AGO? 

The documentation is silent. So I would not assume that
such corrections are exported to AB with a daily download.
But there is a simple way to be sure one gets all the
corrections: Check the "Export history..." option before
doing a download. This will force UA to export the entire
history (however many bars are specified) for all stocks.
With "Export history.." unchecked, the distribution to AB
takes about 1 minute and with "Export history..." checked,
the distribution takes 5 to 8 minutes - not a big deal to
if one wants to be sure of getting all corrections.

SYMBOL CHANGES: WHAT HAPPENS WHEN A STOCK'S TICKER CHANGES?

UA’s documentation does not say, here is what I expect
happens. 

If XXX gets changed to YYY, the XXX ticker would stay in
AB’s database and YYY would get added. XXX will not get any
new data (it will look like a stock that has gone
inactive). YYY will get all the new daily data, but I do
not know if UA will send AB back fill data to match what is
in the XXX ticker. If one is using the forced export of all
data (ie, re-checking the "Export history..." option each
day before starting the CSI download), then YYY will have
its full history.

Thus, daily updates to an EXISTING database in AB will be
fine for trading purposes. XXX’s continued presence is no
problem because I add a filter like:

Active = DateNum() == 1040226;// ie the date of the most
recent data an active stock would have.

IMPORTANT NOTE: this re-checking of the "Export history..."
option must be done before each download because UA will
un-check that option after the export.

Of course, the forced history export will not remove XXX
from Amibroker’s database. (At least, this is my
assumption). Over time, such duplications will increase and
create a significant issue for back testing. 

Fixing this would likely be a major headache for UA
programmers. I suppose, the UA programmers could write a
DLL for AB that would go in and hunt down duplicate tickers
like XXX. But that would be very complex for UA to do. UA
would have to keep a list of such tickers not just for
today, but for however many days since a user updated their
AB database. Right now one can download UA daily data
without updating AB (if one forgets to have AB open before
the download starts). It would get complex for the UA
programmers. A simpler “fix” would be to change all the
existing XXX data to 0.00001 values which would put it
under the radar screens of any conceivable price filter.
That would avoid the need to create a special DLL, but UA
will still have to hold a running list of changed tickers
to handle situations when users are out of town and then do
several days updates all at once. It seems like a real
nightmare of “what ifs” for UA programmers. But, hey, if
they want to do it, that would be great. 

All I am saying is I do not expect UA to provide such a fix
- nor do I need it, because there is an alternative
solution - if one uses the 2 database approach (research
and trading). 

To avoid duplicates, my "research" database is never
updated. It is always created from scratch whenever I want
a new one (once a week, or once a month, or whenever). That
is the way I have had to do it with my CSV imports from CSI
for the past year – create a new AB database each time to
avoid the duplicate problem arising from changes in ticker
names. 

Creatomg a new research database means setting the "Export
history..." to as many bars as one has paid for: at least
3,250 (13 years) in my case. Such an export takes over a
hour on my computer so I would not do it every day. 

Currently my research database of CSI data was created in
another fashion (using a method developed before UA's
direct export was available). So my experience in creating
a "research" database by the direct UA export method is
limited to one experiment. During that long export, I
detected a possible bug. So on to that topic.

POSSIBLE BUG 

UA 2.7.8 did not come out today, so I am still waiting to
see if it removes a possible bug I noticed. For those who
care, a ticker may get missed in the export from UA to CSI
on a random basis. In my case, QQQ did not appear in the AB
database when I exported 3,500 bars of data. When I redid
the UA export (with the forced "Export history..." option
checked and the number of bars reduced to 250), QQQ
appeared the second time. So the bug is at least partially
inconsistent - a tough type for programmers to find and
fix. But I hope UA 2.7.8 will remove it. 

b



__________________________________
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/