Hello, I've asked a similar question before (here) but since then I've been improving my ideas and would like to revisit the issue.
My goal is to develop a VOLUME DELTA indicator that can be used for history and real time data. It should be able to evaluate if a new trade was either a buy aggression or a sell aggression by comparing the trade price with both best bid and ask prices at the exact same moment. Since Amibroker doesn't have bid and ask history capabilities and that any development made on history data should be good to be used in real time, I came to the conclusion that I'd need to calculate past values using a script outside Amibroker and then load the indicator's final values into Amibroker tick by tick (so that each trade in the history have its corresponding indicator value). For real time feed I'd need to check live bid and ask data and write the values to the indicator history database. My questions:
1) What's the least resource-heavy method to store the indicator values for future use that enables me to update it on every single trade? I will use this indicator for backtest so speed is important. I've had bad experiences on other platforms reading TXT files, which turned to be a very slow process due to hard disk read times and searching times within the file
2) Is Amibroker able to read at the same time the trade price (market order) and best bid/ask prices (limit orders) from the times & trades? I cannot wait a microsecond as bid/ask prices are very volatile, because HFTs change them all the time. The ideal solution would be to gather trade price and best bid and ask prices at the same moment using a single function call, so I can guarantee that I'm reading the feed only once not risking to include any new information that could distort the result (such as a new bid or ask price). For instance, using GetRTData(''fieldname'') would yield me 3 distinct function calls (last; bid; ask), so my perspective is that in between these calls one of the variables could have been changed in real time. Another concern is the time elapsed between the identification that a new trade has happened and the return of the values from the function. Often HFTs change bid/ask prices according to trades, so it takes more time for my platform to identify a new trade and send the commands than it takes for the HFTs to change the bid and ask prices (as they're hosted on the exchange servers and hardware coded). Which takes us to #3 below...
3) On Amibroker, how do I know when a new information has been written on the times & trades? Is Amibroker able to identify a new limit order, or does it just identify a new market order? Where no level 2 information is available, a new "tick" is just a new trade, but in this case I might need to identify a change in the order book, which means that a new limit order has been either registered or cancelled. Are there functions to read the live times and trades? Is the Amibroker times and trades complete with all limit orders (bid and ask prices)?
I appreciate your suggestions.