AUX Import Question

Hi Guys,

I’m currently importing an array from SQL into one of my Amibroker routines but finding that it is quite slow. The SQL array doesn’t change so I’d like to try importing the data into the AUX1 field to improve performance. The question I have is this:

I am importing end of month data and when I import using SQL (odbcGetArraySQL()) Amibroker seems to automatically pad the data between the import dates.

When importing into AUX1, is it possible to replicate this same behaviour?

Cheers, Oliver

Just as a follow on from the above question, is there an easy way to set AUX1 = 0 for all stocks and all bars? My AUX1 seems to have some random values in there that I didn’t put in.

Thanks in advance for you help.

Cheers, Oliver


Just a comment here.

If you’re using a data plugin, AUX 1 & 2 are read-only fields.

Here at Norgate Data we use AUX1 and AUX2 for other things (turnover, dividends). Therefore the use of static vars might be better.

Hi Richard,

The problem with using static vars is that we are pulling the data from an SQL database and it is very slow to read into a static var every time we run the code. We were hoping to store the data in AUX so that we can just import once and have the full speed of Amibroker.

I’ve actually successfully set up a tool to import into AUX but for bars that I don’t import, there are some strange AUX values that I didn’t put in. If I could set these all to 0 in advance (perhaps using a COM function?) my problem would be solved.

We actually use Norgate Data for our ASX systems but we are currently working on a system that uses a database of global stocks (hence the SQL database) and we are trying to use AUX1 to store constituent information.

Any other suggestions you have would be much appreciated.


Oliver: you can also use the Persist feature of static vars so they will be loaded each time that AmiBroker starts. This would allow you to load the static vars once, and use them many times without having to read from the DB.

1 Like

Thanks guys! Using persistent static vars has worked perfectly. Much appreciated.