How does amibroker store past bid ask prices?

0 votes
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.
asked Jun 24, 2017 in AFL Code Wizard by Eduardo

1 Answer

0 votes
For example IQFeed plugin stores Bid/Ask data to Aux fields.
answered Jun 25, 2017 by fxshrat (1,200 points)
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.
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.
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.
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

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 );
Thanks a lot, that was really clarifying!