I’m working on OANDA a real-time data plugin (C#/.NET) for AmiBroker that provides intraday bars (fast startup ~3 days or intraday backfill ~60 days) and EOD/daily backfill (~20 years or 5000 bars). After a deep daily backfill looks correct but, **restarting AmiBroker causes the chart to show only the fast startup (3 days * ) , as if the saved daily history is ignored or overwritten.
However, the Real‑Time Quote window is working fine. What I still don’t understand is how to handle backfilled intraday and historical data. Oanda provides up to 5,000 bars for almost all timeframes, which is more than enough for me to trade these forex pairs.
Any help would be greatly helpful and would like to share the plugin here
Environment
AmiBroker version: Tested on 6.10 as Well on 7.0
32-bit / 64-bit: 64 Bit
Windows: 11 Pro
Database type: Intraday DB with mixed data
Database Settings:
Local Data Storage: Enabled
Allow mixed EOD/intraday data: Enabled
Base time interval: 1 Minute
Number of bars: 5000 bars / 5000 bars on EOD
Data source: Custom RT plugin (GetQuotesEx implementation)
I set the limit to 200,000 bars, which is roughly 416 days.
Here’s the current behavior:
On the initial load of AmiBroker, I fetch the last 3 days of data (about 5,000 bars). This works perfectly.
When I run a full EOD backfill (20 years, also 5,000 bars), that works as well.
The problem is that after restarting AmiBroker, the EOD data is gone. It looks like the historical data isn’t being saved and is getting overwritten by the fast backfill of the last 3 days.
Am I missing a step here, or is there a specific action I need to take to ensure the EOD data persists across restarts?
In "mixed intraday EOD/intraday" mode, inside your plugin you have to MERGE Intraday data and EOD data into SINGLE array that has BOTH data sets ordered BY bar date/time. EOD records as explained in the ADK, have special timestamp that allows them to come AFTER intraday bars of desired day.
You did not provide ANY CODE of what you are doign GetQuotesEx and because of that it is guessing game.
Is the plugin OPEN SOURCE? If it is, provide GitHub/GitLab URL.
just to add a visual idea, lets say your intraday data is 10 days and your EOD data is 10 years, ie. 365*10 approx (no leap/holiday for example sake)
then 365*9 + (YTD_bar_count - 10 intra ) bars are all in succession from index==0
then, only the last 10 EOD bars appear after each intra data for that day.
So when you will reach nSize, you will be dropping those EOD bars first.
When you backfill again, you need to respect the order of datetime.
Thank you for your time. I've done deep research into AmiBroker's design architecture and studied the examples in the C++ ADK. I began working with the C# SDK by Kriasoft, but encountered issues—it felt bolted-on, and when I added real-time data via Event Source, I saw high RAM usage and random crashes. This experience suggests that C++ is the better choice if I must go with a native plugin approach.
However, my current focus is on building a back testing version with reasonable refresh times—I don't require a real-time quote window. I'm currently evaluating two architectures:
C++ Data Plugin (ADK) – Direct integration with AmiBroker's data feed interface
ASCII/OLE Automation Model – External service writing CSV files or pushing data via COM
For backtesting you should rather push data into Amibroker native database as it is faster than any plug-in, especially if you did not write plugins before.