Australian (ASX) Stock Market Forum

Best way to use Amibroker to save NTA history for LICs

Joined
15 February 2017
Posts
9
Reaction score
0
I"m a new Amibroker user, fairly impressed with the power and flexibility. Back testing is amazing, once you get into the AFL formulas.

Now I want to run a LIC (Listed Investment Company) back test that buys based on NTA discounts but I don't see how any historical values can be stored, other than price.

The data I need to store is DATE, TICKER, PRICE, NTA
e.g.
31 January 2017, XYZ, 400, 420
31 December 2016, XYZ, 390, 405
30 November 2016, XYZ, 391, 403

(I have the monthly close NTAs going back a few years.)

First, I though fundamental information might be the right place but isn't it overwritten after each change so I would not be able to see what the NTA was in like 2002?

Then I thought I might have to do a nasty hack and fill the Open price with NTA and rely on the the close alone for true price information.

I hope there is a cleaner solution as Amibroker seems to have thought of everything else.
 
Joined
31 March 2012
Posts
413
Reaction score
19
Other ways (if there're more than two additional columns of data):

1. - Using AmiBroker's ODBC plugin reading the data from external (3rd party) database. www.amibroker.com/odbc.html
Most recent version is 1.6.0. In addition it comes with source code. So you may change it to your needs.

2. - Or reading and storing the data to matrix and saving it to static or persistent variable (via StaticVarSet). Then if required calling it and comparing datetime rows with symbol's datetime array to check for true/false.

You can now even read from Internet directly using newly implemented functions InternetOpenURL(), InternetReadString(), InternetClose().

Here is an example picture where I am reading fundamental data from this sample Internet source http://www.stockpup.com via upper mentioned Internet functions storing the data to matrix once (again see StaticVarSet) and then reading and comparing to symbol array. And if there is a change such as changing symbol or an update of new data then ensure it auto updates just once again . Since it is a table (matrix) I can easily scroll through each of the 29 available columns (via Param() slider).

As you may know the saying goes: "Multiple roads lead to Rome".

a0BH3rr.png
 
Joined
15 September 2004
Posts
60
Reaction score
4
The data I need to store is DATE, TICKER, PRICE, NTA
e.g.
31 January 2017, XYZ, 400, 420
31 December 2016, XYZ, 390, 405
30 November 2016, XYZ, 391, 403

You could always create another ticker for the nta. e.g XYZ_NTA and just treat it like another price series.
 
Joined
15 February 2017
Posts
9
Reaction score
0
Thanks for the help. I ended up just using the import wizard and storing the pre and post tax NTA in Aux1 and Aux2. It was a bit tricky but it seems to work.

Now I've realised that I am missing dividend histories in my data. Will Premium Data supply that? Plus, I can't find any documentation on dividend reinvestment functions in Amibroker - can it do this?
 
Top