• Australian (ASX) Stock Market Forum

Hello and welcome to Aussie Stock Forums!

To gain full access you must register. Registration is free and takes only a few seconds to complete.

Already a member? Log in here.

Best way to use Amibroker to save NTA history for LICs

Discussion in 'Software and Data' started by ProphetMines, Feb 15, 2017.

  1. ProphetMines

    ProphetMines

    Posts:
    9
    Likes Received:
    0
    Joined:
    Feb 15, 2017
    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.
     
  2. DaveDaGr8

    DaveDaGr8

    Posts:
    104
    Likes Received:
    20
    Joined:
    Jun 29, 2007
  3. trash

    trash

    Posts:
    407
    Likes Received:
    10
    Joined:
    Mar 31, 2012
    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
     
  4. kefa

    kefa

    Posts:
    60
    Likes Received:
    4
    Joined:
    Sep 15, 2004
    You could always create another ticker for the nta. e.g XYZ_NTA and just treat it like another price series.
     
  5. ProphetMines

    ProphetMines

    Posts:
    9
    Likes Received:
    0
    Joined:
    Feb 15, 2017
    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?
     
Loading...

Share This Page