Disable or programmatically flush in-memory cache?



I am reading price data from text files using a custom dll similar to the ASCII example from the ADK. I use a separate application to apply price adjustments and filtering, and construct the data file.

The AmiBroker in-memory cache prevents updated data files from being loaded if a symbol has already been viewed. I need to manually flush the cache using the Database Settings window to force a reload each time I update my files.

I see that I can reduce the number of cached symbols and cache memory using Preferences->Data, but have found no way to turn it off completely. AmiBroker does not allow the max number of symbols to be zero.

I’m looking for a way to either disable the in-memory cache or programmatically flush it when the data files change.

Does anyone know of a way to do this?

Thanks in advance!


I don’t know if it’s going to work in your case (maybe not), but you can try adding at the top of your formula:

#pragma nocache

I quote:

#pragma nocache causes that #included files are not cached so they are re-read with every execution



No, AmiBroker does not prevent updated data from being loaded.

You just did not tell AmiBroker that you have new data inside your plugin.

To tell AmiBroker that you have new data you need to send a message to AmiBroker (WM_USER_STREAMING_UPDATE) as shown in QuoteTracker example sources,

// this tells AmIBroker that you have fresh data for given Ticker
::SendMessage( g_hAmiBrokerWnd, WM_USER_STREAMING_UPDATE, (WPRAM) Ticker, (LPARAM) &recentInfoStructureForGivenTicker );

If you just make AmIBroker aware that you have new data, it will call GetQuotesEx once again and you will get opportunity to fill the array with your updated quotes.


Thank you Tomasz. I didn’t consider treating this as a real-time data source.