How does amibroker store past bid ask prices?

0 votes
asked Jun 24, 2017 in AFL Code Wizard by Eduardo
As amibroker keeps flashing the bid and ask prices in real time, it means it's reading the top of book limit orders. Where is this information stored and how can I have access to it to use it in my code? I want to compare last price to previous best available ask and bid prices. Also, at every trade (tick) the exchange sends at the same moment a new bid or ask price and volume, how can I check it? Thank you.

1 Answer

0 votes
answered Jun 25, 2017 by fxshrat (1,200 points)
For example IQFeed plugin stores Bid/Ask data to Aux fields.
commented Jun 25, 2017 by Eduardo
How do I read those fields? Does it keep historic values? I suppose this is not broker specific, so not particular to IB. Does it backfill?

 Amibroker only executes code once a new trade (tick) comes through, limited to 10 refreshes per second, or manually. AFAIK, there's no trigger for bid and ask prices being sent to the exchange.
commented Jun 25, 2017 by fxshrat (1,200 points)
You read Aux fields the same way as you read OHLCVOI fields. They are all ARRAYS and are part of AmiBroker database (DB). And yes, Aux fields store historical data.

BTW, Aux stands for auxiliary.
commented Jun 25, 2017 by Eduardo
That's great news indeed. Any documentation on that matter with examples? It'd be perfect if I could compare bid/ask history with tick (trades) history.
commented Jun 25, 2017 by fxshrat (1,200 points)
edited Jun 25, 2017 by fxshrat
As mentioned aux fields are array fields just like OHLCVOI fields. And for example AmiBRoker's IQFeed plugin stores bid/ask to aux fields itself. If you want to create your own data plugin for different data vendors then use AmiBroker's C/C++ ADK.  Also you can import ASCII data to aux fields just like you can import OHLCVOI. Following sample link refers to ASCII import http://www.amibroker.com/kb/2015/01/29/importing-auxilliary-data-into-amibroker-database/

If you want to call aux fields then again you do it same way as with other fields,
for example a basic plot
Plot( Aux1, "Aux1", colorRed, styleline );
commented Jun 25, 2017 by Eduardo
Thanks a lot, that was really clarifying!
...