Skip to content
All library documents

Using Linear Discriminant Analysis for Trading Signals and Risk Sizing

Article MQL5 articles

Summary

The article explains linear discriminant analysis (LDA) as a way to project labeled data into a lower-dimensional space that emphasizes class separation. It contrasts LDA with PCA, which prioritizes overall variance, and QDA, which estimates separate class covariance matrices at the cost of more parameters. It also distinguishes LDA’s use of continuous inputs and categorical labels from ANOVA’s setup, then outlines the within-class and between-class scatter matrices used to derive the projection directions.

For an MQL5 expert advisor, the author prepares USDJPY daily close-price data in discretized, normalized, continuized, and raw forms. LDA projections are used to classify current observations, with the article also exploring the output as a signal, trailing indicator, and position-sizing input. The reported tests favor discretized range changes for money management, but the article supplies no detailed performance figures in the provided text. Its experiment covers a limited period and data setup, and the author explicitly calls for testing more diverse data over longer histories.

Key ideas

  • LDA seeks projection directions that separate labeled classes, while PCA seeks directions of greatest overall variance.
  • LDA assumes equal class covariance for classification, whereas QDA estimates a separate covariance for each class and requires more parameters.
  • The article forms within-class and between-class scatter matrices to derive LDA projection vectors.
  • The MQL5 example tests four representations of USDJPY close-price data as features and class labels.
  • The author reports that discretized range changes appear most promising for money management, while noting the experiment is limited.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.