Skip to content
All library documents

Using Shannon Entropy and Random Forests to Generate Trading Signals

Article MQL5 articles

Summary

The article introduces Shannon entropy as a measure of uncertainty in a set of outcomes, illustrating how greater variety in event probabilities produces higher entropy. It then describes decision trees and random forests, including bootstrap sampling and random feature selection as ways to diversify trees and reduce correlated errors. These concepts are applied to a MetaTrader 5 signal that separately considers entropy in positive and negative price bars, with market indicators and past trade outcomes used in the signal process.

The article reports optimized Strategy Tester results for two expert advisors: one using the signal with minimum-volume money management, and another adding a money-management class. The latter has higher reported profit factor and Sharpe ratio. However, the configurations were optimized on four-hour open prices for selected stop-loss and take-profit settings. The author cautions that the figures are not expected to reproduce in live trading or every-tick testing. They are therefore optimization-specific examples, not robust evidence of a persistent edge.

Key ideas

  • Shannon entropy measures uncertainty based on the probabilities of possible outcomes.
  • Random forests combine tree votes, using bootstrap samples and random feature subsets to encourage diversity.
  • The proposed signal evaluates entropy for rising and falling price bars separately.
  • The reported tester results favor the version with additional money management.
  • Results depend on optimization settings and are not presented as reproducible live performance.

Tags

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