PureBytes Links
Trading Reference Links
|
I need to store some calculations for each ticker for each day so
that I can use them in backtester without having to go through a
custom formula. The calculations are lengthy, so I can't afford to do
it as a formula. Given this criteria, I thought I'd do the following
using ABTool -
1. Run an exploration or a scan once that does nothing but creates a
table file for each day.
2. Run another exploration or a scan that calculates the values for
all tickers and store them in the respective table for the day.
3. Grab the value for the respective ticker from the respective table
files in backtest.
(As a side note, if anyone knows a better way other than using
Composites, please suggest.)
So here's a little piece of code that I tried to implement step 1, to
create the tables -
-------
xxABtoolInit();
tableNum = xxTableCreate();
xxTableColumnAdd("Ticker", 3, tableNum, 64, 0);
xxTableColumnAdd("Close", 1, tableNum, 64, 0);
// Following returns me a unique filename based on "current" DateNum()
tableFile = jDailyUniqueFilename("XX_", ".dat");
xxTableExportBinary(tableFile, tableNum);
--------
When I run this on a single stock for say last 5 bars, what I see is
that only one file is created, and that too with the date for last
bar in my dataset.
So that's making me wonder about the sequence of how a scan or
explore works. I was thinking that since I'm selecting only "current
stock", it'd go through this code for last 5 days, and hence my code
that uses DateNum() to generate filename would create appropriate
file for each day, and I'd have 5 empty table files as desired. Is
that not what should happen? I'm baffled that I get only one file in
the end, with only the last dated file.
Jitu
PS: I'm fairly positive that my function returns a unique name based
on current value returned by DateNum(). I verified this by replacing
the above mentioned call by a simple DateNum() call.
------------------------ 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/l.m7sD/LIdGAA/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
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
|