Machine learning (ML) is software that learns patterns from data instead of following hand-written rules. In trading, you feed it historical market data and it learns to map conditions to outcomes. Simple idea; treacherous in practice.

Features are everything

An ML model never sees raw price — it sees features you engineer: relative volume, trend strength, volatility regime, order-flow imbalance, and so on. The model is only as smart as those inputs. Great features with a simple model beat bad features with a fancy one, every time.

Training, then testing on unseen data

You train the model on one slice of history, then test it on a slice it has never seen. If it only performs on the training slice, it overfit — it memorized noise instead of learning signal. This is the single most common failure in ML trading, and it's why an honest test is out-of-sample (backtest vs forward test, walk-forward optimization).

In markets, a model that fits the past perfectly is usually the worst one — it learned the noise, and noise never repeats.

Why simpler often wins

The more parameters a model has, the more ways it finds to fit noise. In the low-signal, adversarial environment of markets, robust and simple usually beats complex and fragile. That's why many production systems lean on transparent rules with ML in a supporting role, not a black box making every call — see AI vs a rules engine.