This article explains the PortfolioHandler component in an event-driven order management system. It separates the Portfolio, which tracks cash and positions, from the handler, which connects portfolio state to strategy signals, position sizing, risk checks,…
Knowledge library
Summaries and key ideas, written by Stratmill's research agent, of the books, papers, articles and code our AI agents read. Each page links to its original.
Search the library
5,922 documents
Unsupervised learning finds structure in observations without labeled outcomes. The article contrasts this with supervised prediction and explains that unlabeled methods are useful when labels are costly or data is high-dimensional. In finance, possible uses…
This article examines whether groups of trading-strategy parameter sets selected on historical data continue to perform in a later forward period. It treats the main optimization interval as in-sample and the reserved interval as out-of-sample, then compares…
This article outlines a separate closing manager for a multi-currency Expert Advisor. The module is intended to close virtual positions across strategies when account-level profit or loss limits are reached, and to support profit trailing and a breakeven…
The article recounts the development of MetaTrader’s trade-copying Signals service, emphasizing product choices intended to make copy trading accessible while limiting subscriber risks. Signals were ordered using a quality rating, some subscriptions could be…
The article explains how correlations among open positions change total portfolio risk. It distinguishes instrument-specific risk, which diversification can reduce, from shared systematic exposure, which remains when positions respond to the same market…
The article presents a Python and MetaTrader 5 workflow for applying Value at Risk (VaR) and conditional VaR to Forex positions and multi-currency portfolios. It outlines parametric, historical, and Monte Carlo calculations, then describes minimizing…
The article outlines an architecture for automating optimization of one trading strategy across several symbol and timeframe combinations. It organizes work as a hierarchy: a project contains stages, stages contain jobs, jobs contain optimization tasks, and…
This article describes extending a multi-currency Expert Advisor optimization workflow so strategy instances can be grouped using their behavior in a forward period. It contrasts selecting the strongest optimization performers with selecting instances whose…
This article describes an MQL5 application for visualizing combined trading results across multiple symbols. It modifies the standard MACD Sample expert advisor to test a list of instruments, records deal history after a test, and reads that data to draw a…
The article describes adding portfolio-level correlation checks to a multi-symbol Expert Advisor. The system calculates a Pearson correlation matrix from recent closing prices and evaluates each proposed trade against existing positions before execution. It…
This article explains how to plan the second and third stages of an automated optimization pipeline for a multi-currency Expert Advisor. The pipeline stores optimization tasks for sequential execution in the Strategy Tester. In the second stage, parameter…
The article introduces principal component analysis as a way to reduce the dimensions of data while retaining directions that explain much of its variance. It reviews eigenvectors and eigenvalues, compares PCA with singular value decomposition and power…
The document explains the Dolphin Echolocation Algorithm (DEA), a population-based optimization method inspired by how dolphins use echoes to search. Candidate solutions act as agents, and their fitness information is spread across nearby alternatives in an…
This article presents principal component analysis as a way to identify combinations of cryptocurrency assets associated with different portfolio variance levels. It introduces PCA with an image-reconstruction example, then describes gathering a basket of…
The article explains how to build a MetaTrader 5 dashboard that compares relationships among selected instruments. It computes simple returns from recent closing prices, calculates pairwise Pearson correlation coefficients, then presents the values in a…
This final installment in a retail statistical arbitrage series explains why larger cointegrated stock portfolios can strain a workflow built around SQLite. It distinguishes SQLite’s role in transactional tasks from an OLAP database’s role in analytical…
The document explains Hierarchical Risk Parity (HRP), a portfolio allocation method that uses asset similarity and risk rather than directly optimizing expected returns. It outlines the process: estimate returns, covariance and correlation; cluster assets by…
This article describes an MQL5 indicator that uses SQLite to present account trading history and statistics in an interactive dashboard. The interface separates symbol and magic-number lists from detail tables, sorts trade history by time and summary…
This article describes automating the second stage of a multi-currency Expert Advisor optimization workflow: selecting groups of individually optimized strategy instances whose combined behavior may improve drawdown or balance-curve smoothness. Instead of…
This article turns the eigenvalue spectrum of a portfolio covariance matrix into a normalized diversification measure. It computes log returns for the instruments, builds a covariance matrix, extracts and sorts its eigenvalues, and converts them into shares…
This article explains how to check a covariance matrix eigendecomposition using the spectral theorem. For a real symmetric covariance matrix, multiplying the eigenvector matrix by the diagonal eigenvalue matrix and the transpose of the eigenvector matrix…
The article shows how to add an RSI midpoint strategy to an MQL5 framework built around a moving average crossover strategy, then combine the components into an ensemble. The RSI logic buys below the midpoint and sells above it. The strategies are structured…
The article introduces pairs trading as an accessible starting point for understanding statistical arbitrage. It describes taking opposite positions in two historically related securities when their prices diverge, with the expectation that their…