Before Project Green and Project Iris there was Project Amber, CFIN's first Expert Advisor. It was written natively in MQL5 for MetaTrader 5 and traded many symbols from one terminal. This is a short, deliberately plain look at how it was built. The full story is told in the Amber series.
How it was built
Amber ran entirely inside the MetaTrader 5 terminal, on a virtual private server. The decision logic lived in the terminal. State and settings moved between the terminal and CFIN's servers over web requests, which is how the dashboard could show an account and how settings could be changed centrally.
The sketch below shows the shape of a terminal-bound engine. It is a simplified illustration, not an extract of the production source, and it deliberately contains no thresholds:
// Illustrative shape of a terminal-bound engine. Not production code.
class Engine {
public:
bool OnTick(const MqlTick &tick) {
if (!SpreadAcceptable(tick)) return false; // per-tick check
if (InNewsWindow(tick.time)) return false; // padding around scheduled releases
if (!WithinDrawdownBudget()) return false; // account-level limit
return PlaceRestingOrder(); // limit or stop order with a computed stop
}
};
What carried forward
- Per-tick checks: spread and the news calendar are checked before an order is calculated.
- Volatility-based sizing: position size and stops are calculated from market volatility, not from fixed point counts.
- Account-level limits: a drawdown limit and a cross-symbol correlation guard sit above any single trade.
We are not publishing performance figures or thresholds for Amber. Past performance is not a reliable indicator of future results, and the figures that CFIN does publish are on the Performance page.