Inspired by the example of ADK, I'm writing a simple plugin to update the database with EOD.
From menu action or from expiration time, I recover one file with EOD data for multiple symbols and one or many days.
The update works well only for the AB active ticker.
The plug-in caches all data from file on the corresponding structure as RecentInfo and Quotation.
If I modify the active ticker from AB, the GetQuotesEx cb function will be called and the data will be updated from the cache.
I send SendMessage (g_hAmiBrokerWnd, WM_USER_STREAMING_UPDATE, (WPARAM)ri->Name, (LPARAM)ri ); for all tickers from file; but only active ticker is updated.
I supose that i don't handle well
ri->nStatus = RI_STATUS_UPDATE | RI_STATUS_TRADE | RI_STATUS_BARSREADY;
ri->nBitmap = RI_LAST | RI_OPEN | RI_HIGHLOW | RI_DATEUPDATE | RI_DATECHANGE;
That is wrong on my code ?
One other issue is that not all tickers present on import file are interested and present on AB database, how can i retrive in plugin all tickers from AB ?
@GruiaS, I don't know the API side, but you might be able to run an exploration that touches each item in your database, and have your api call in the default chart, so it would become the active ticker and then make the api call for the data.
AmiBroker does not do stupid things. It would be stupid (and inefficient) to call GetQuotes when quotes are NOT really needed. WM_USER_STREAMING_UPDATE message tells AmiBroker that new data are available in the plugin, but IF and WHEN AmIBroker needs them depends on what you are doing in AmiBroker. It only calls GetQuotes IF and WHEN data are REALLY needed. If you watched 2 charts it would ask for data for those 2 symbols. If you watched 10 it would ask for 10, if you run scan for ALL symbols, it will call GetQuotes for ALL symbols.
I'm sure AmiBroker does not do stupid things. I thought it was possible and reasonable to behave like AmiQuote when all the symbols of DB can be updated in one step (import) without the need for action in the interactivity of AB. From the examples in ADK and various topics I understand how the GetQuotes work.
Thanks.
AmiQuote does not use ADK. ADK is mainly for real-time. AmiQuote uses OLE automation ASCII Import method which is much better suited for EOD, http://www.amibroker.com/guide/objects.html