Australian (ASX) Stock Market Forum

Reply to thread

Here is what happens when you run the script:


[ATTACH=full]70726[/ATTACH]


If you press enter, it will just iterate through the tank displaying what was fed into it.


So starting at the top, we display the following:


Total records inserted which is the number of successfully inserted rows from the csv file(/s). Any errors will be displayed.


Total securities


Max security records which is the maximum number of records any security has in the current pool of data (tank). This is an important number because when we fetch the price arrays for each security in memory, we need to dynamically allocate this amount of elements beforehand. Not doing this will cause a segmentation fault.


Database load time which is how long it took for the shared library to load the data from csv file into memory (tank).


After that we run 3 timed loops on iterating through all 2000 securities stored in memory (tank).


First we see how long it takes to iterate through securities while doing nothing 2000 times.


Next we time how long it takes to fetch all 2000 security prices.


Finally we time how long it takes to compute a simple moving average 2000 times.


Hopefully viewing the code in the python script will make things more clear. It can be made to do much more, but will serve as a good template for now :).


Top