Not all plugins are real-time. Many developers need to create plugins that import historical data from custom text formats or binary files. The AmiBroker community has long maintained open-source examples of custom ASCII importers.
Why it is a Top Resource:
This source code focuses on the Import functionality rather than the streaming GetQuotes functionality.
The official resource for AmiBroker data plugin source code is the AmiBroker Development Kit (ADK). 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
AmiBroker Development Kit (ADK): The definitive starting point for writing your own plugins. It includes C++ source code examples for plugins like QuoteTracker and QP2.
Access the ADK on GitLab for the base source files and documentation.
AmiBroker .NET SDK: If you prefer working with C# or .NET rather than native C++, this open-source SDK allows you to create data plugins more easily.
Explore the kriasoft AmiBroker .NET SDK on GitHub for full implementation details, including the DataSource.cs template.
WsRtd WebSocket Data Plugin: A modern, high-performance plugin that uses WebSocket-JSON communication for real-time data streaming.
Find the Rtd_Ws_AB_plugin source code on GitHub, which is broker-agnostic and supports historical backfilling.
Q2Ami Plugin: An open-source project on GitHub that provides headers like Plugin.h detailing the AmiBroker plugin interface structure. Quick Implementation Steps
Download the SDK: Start with either the official C++ ADK or the community .NET SDK.
Define Plugin Info: Update the GetPluginInfo() method with your plugin's metadata.
Implement Data Logic: Add your quote-fetching logic inside methods like GetQuotesEx() or the equivalent in your chosen language.
Install: Compile your code into a .dll and place it in the C:\Program Files\AmiBroker\Plugins directory. amibroker data plugin source code top
Do you need help debugging a specific error in your plugin's C++ or .NET implementation?
Download the Ib.dll (data plugin) source code - Plug-ins - AmiBroker Community Forum
To understand how AmiBroker data plugin source code works, it helps to view it through the lens of a developer building a bridge between raw financial data and a high-speed charting engine The Quest for "Total Control": A Developer’s Story
In the world of quantitative trading, data is everything. For many developers using
, the standard data feeds aren't enough—they need to connect to custom APIs, proprietary databases, or specialized brokers. This is where the AmiBroker Development Kit (ADK)
becomes the "holy grail" for those seeking "Total Control" over their data arrays. 1. Building the Foundation (The DLL) Our story begins in Microsoft Visual C++ (or even the free ). An AmiBroker data plugin is essentially a Win32 Dynamic Link Library (DLL)
. To make it talk to the main program, every plugin must expose three core functions: GetPluginInfo : Tells AmiBroker who you are (your plugin's name and ID).
: The handshake where the plugin wakes up and prepares its connections. : The graceful exit when the user closes the database. 2. The Bridge to Data A developer starts with a simple project template from the . They copy Plugin.cpp
into their workspace. In these files, they define how to handle "Quotes." The plugin acts as a translator: it takes incoming data (like a JSON stream from a WebSocket) and converts it into a format AmiBroker understands—specifically, an array of structures containing Date, Time, Open, High, Low, Close, and Volume. 3. Real-Time vs. Backfill Starting Data plug in project - Amibroker Forum
Developing an AmiBroker data plugin requires using the AmiBroker Development Kit (ADK)
, which provides the necessary C/C++ headers and sample source code to link external data feeds into the AmiBroker engine. Core Architecture
AmiBroker data plugins are standard Win32 DLLs (32-bit or 64-bit) that implement a specific set of exported functions. The engine communicates with these DLLs to request price data for specific tickers and timeframes. about.gitlab.com 1. Required Standard Exports
Every AmiBroker plugin must export these three core functions: GetPluginInfo Not all plugins are real-time
: Returns basic metadata like the plugin name, vendor, and a unique 4-character ID (PIDCODE). : Called when the plugin is loaded to initialize resources. : Called when the plugin is unloaded to free memory. 2. Primary Data Functions
To act as a data source, the plugin must implement functions to provide quotes: GetQuotesEx
: The modern function for fetching historical and real-time data. It receives a ticker name and periodicity and must fill a buffer with price arrays (Open, High, Low, Close, Volume, etc.). GetPluginConfig
: (Optional) Provides a custom configuration dialog for users to enter API keys or server settings.
: Used to inform AmiBroker of status changes (e.g., connection lost or new data available). AmiBroker Community Forum Key Development Resources
Optimizing Real-Time Data Plugin for Multiple Tickers - Plug-ins
Developing a high-performance data plugin for AmiBroker requires a deep understanding of its C++ SDK and the mechanics of real-time data streaming. AmiBroker’s architecture is designed for speed, and its plugin system allows developers to feed external market data—whether from a REST API, WebSocket, or local database—directly into the software’s database engine. The Foundation of an AmiBroker Plugin
The core of any AmiBroker data plugin is a dynamic link library (DLL) written in C++. AmiBroker provides a specialized Software Development Kit (SDK) that defines the required entry points and structures. The most critical component is the PluginInfo structure, which tells AmiBroker the name of the plugin, its version, and what capabilities it supports, such as intraday data, tick-by-tick updates, or backfill functionality.
To initiate communication, the plugin must export several mandatory functions. The GetPluginInfo function is the first point of contact, providing metadata to the host application. Once the user selects the data source in AmiBroker's settings, the Init function is called to set up resources, while Release handles the cleanup when the application closes or the data source is changed. Managing Data Streams and Backfills
The true complexity of a data plugin lies in how it handles the GetQuotes and GetExtraData functions. AmiBroker operates on a "pull" or "notification" basis. When the software needs to update a chart, it calls the plugin to see if new data is available. A robust plugin must implement an efficient buffering system. Since market data often arrives in bursts, the plugin should store incoming ticks in a thread-safe queue and then flush them to AmiBroker's memory structures during the update cycle.
Backfilling is another essential feature. When a user opens a new symbol, the plugin must recognize that historical data is missing and trigger a request to the data provider's server. This is typically handled through a background thread to ensure that the AmiBroker user interface remains responsive while the historical bars are being downloaded and processed. Performance and Stability Considerations
Because AmiBroker is a 32-bit or 64-bit multi-threaded application, thread safety is paramount. Developers must use mutexes or critical sections when accessing shared data structures to prevent crashes. Furthermore, memory management must be impeccable; leaking memory in a data plugin will eventually lead to system instability, especially during long trading sessions where millions of ticks may be processed.
Optimization is also key. Using efficient data structures for symbol lookups, such as hash maps, and minimizing the overhead of string manipulations can significantly improve the speed at which the plugin feeds data to the UI. A well-coded plugin not only delivers data accurately but does so with minimal CPU footprint, allowing the user to run complex AFL (AmiBroker Formula Language) scripts without lag. Conclusion The official resource for AmiBroker data plugin source
Creating a top-tier AmiBroker data plugin is a bridge between raw financial data and sophisticated technical analysis. By mastering the C++ SDK, implementing reliable threading models, and ensuring efficient data throughput, a developer can create a seamless experience for traders. While the initial development curve is steep, the resulting ability to integrate any data source into AmiBroker provides a powerful competitive edge in the world of automated trading and market analysis.
Before diving into source code, we must understand the hierarchy. Amibroker uses a Plugin SDK (Software Development Kit) to interface with external data sources. The "top" plugins (like those for Interactive Brokers, eSignal, or custom WebSocket feeds) share three traits:
Building your own plugin gives you absolute control: you can connect to proprietary APIs, crypto exchanges, or DDE servers without paying monthly data fees.
// Inside GetQuotesEx - simplified
if (action == ACTION_GET_HISTORY)
http_client.fetch(symbol, interval);
for (int i = 0; i < barCount; i++)
pQuotes[i].fOpen = bars[i].open;
pQuotes[i].fHigh = bars[i].high;
// ... etc
Top feature: Dynamic symbol registration via websocket discovery.
If you are selling or sharing the source code, add these:
Summary
Findings
Recommendations (actionable)
Next steps I can perform (pick one)
Which next step do you want?
(Invoking related search-term suggestions.)
Every plugin must implement: