ADK Development Q&A


Hi all,

how I can tell AmiBroker to call custom function after initiation in data plugin? It may be obvious but i didn't find it in documentation, only predefined functions are mentioned in official ADK help.


In data plugins you don't call custom functions. Callable, user-definable functions are only exposed by AFL plugins.


Hi Tomasz, thanks for you answer. Let me explain what I wanna achieve: I’m using plain, unmodified ASCII plugin. Data source exporting 2 last bars of 1 minute timeframe data every 5 seconds to ASCII folder in main AB directory. Everything works fine, but quotes won’t get update until F5/Refresh is pressed. I’ve noticed that calling Application.RefreshAll() method every 1 second will do the same job like calling:

::SendMessage( g_hAmiBrokerWnd, WM_USER_STREAMING_UPDATE, 0, 0 );

Alternative option would be to call SendMessage function from outside of AB (from data source), however I’d like to have that implemented in DLL. So my goal would be ability to call SendMessage function every 1 sec.

Any other workaround would help.


INSIDE your plugin, you should just setup a timer (SetTimer WinAPI function) that calls ::SendMessage( g_hAmiBrokerWnd, WM_USER_STREAMING_UPDATE, 0, 0 );

Look for QT source included in the ADK. It contains ready to use code.


Thanks, that should help. I'll post code on GitHub once ready so other users can make a use of it too.