If you've reached the point where the standard AmiBroker feature set isn't enough, you're in good company. The real magic of the platform lies not just in what it can do out of the box, but in how you can extend it.
__declspec(dllexport) int WINAPI GetQuotesEx(LPCTSTR TargetSymbol, int Periodicity, int LastQuoteDesired, int MaxQuotes, struct Quotation *pQuotes, struct RecentInfo *pRecentInfo) // 1. Check if the requested symbol is valid // 2. Fetch data from your internal cache or trigger an API request // 3. Loop through your fetched records and populate the pQuotes array int quotesFetched = 0; for(int i = 0; i < MaxQuotes; i++) // Example mapping logic pQuotes[i].DateTime = ConvertToAmiBrokerTime(YourDataSrc[i].Timestamp); pQuotes[i].Open = YourDataSrc[i].OpenPrice; pQuotes[i].High = YourDataSrc[i].HighPrice; pQuotes[i].Low = YourDataSrc[i].LowPrice; pQuotes[i].Price = YourDataSrc[i].ClosePrice; // 'Price' is Close pQuotes[i].Volume = YourDataSrc[i].Vol; pQuotes[i].OpenInterest = 0; quotesFetched++; // Return the total number of bars populated into the array return quotesFetched; Use code with caution. 4. Implementing Real-Time Streaming (WebSockets & Threads)
Copy the compiled .dll directly into the AmiBroker/Plugins directory.
Compile your Visual Studio project to generate a target .dll file (e.g., CustomAmiDataPlugin.dll ). amibroker data plugin source code top
Requires a multi-threaded approach. Your source code should have a background thread listening to a WebSocket or Socket connection, pushing new ticks into a thread-safe queue that GetQuotesEx can then drain. 4. Best Practices for Professional Source Code
The official resource for AmiBroker data plugin source code is the . While the source code for proprietary plugins like Interactive Brokers is not publicly available, the ADK provides full example codes for various data plugins to help you build your own. Top Official & Community Resources
Access the for the base source files and documentation. If you've reached the point where the standard
AmiBroker is a preferred platform for quantitative developers due to its fast backtesting engine. However, the software relies entirely on external market data. While commercial data vendors offer built-in connectors, proprietary data feeds, niche crypto exchanges, or institutional APIs require a custom data plugin.
The definitive starting point for writing your own plugins. It includes C++ source code examples for plugins like QuoteTracker and QP2 .
The AmiBroker ADK includes a "Sample" folder with a fully functional (though basic) implementation. Reviewing the Sample.cpp file is the best way to understand the data flow. Check if the requested symbol is valid // 2
This public link is valid for 7 days and shares a thread, including any personal information you added. This link or copies made by others cannot be deleted. If you share with third parties, their policies apply. Can’t copy the link right now. Try again later.
The decision between C++ and .NET is a trade-off between raw performance and development efficiency.
To help refine this implementation for your trading setup, tell me:
What (e.g., Interactive Brokers, IQFeed, Binance, WebSockets) are you connecting to?