Skip to content
All library documents

XGBoost Mini Strategy with Rolling Training and Trailing Stops

Article TradingView scripts

Summary

This long-only strategy trains a small XGBoost model on a rolling sample and uses its estimated probability of an upward move to guide entries and exits. It builds six inputs from RSI, price distance from an EMA, rate of change, normalized ATR, relative volume, and the close's position in a recent high-low range. Beginning after an initial warm-up, the model is retrained periodically on recent observations labeled by whether price rose over a short future interval.

An entry requires probability above a configurable threshold, price above a short SMA, and a brief cooldown after an exit. The script exits when probability weakens, subject to a profit condition and holding filter, or when a trailing stop rises behind price. The post includes favorable historical performance statistics, but they are presented without independent validation or detailed methodology. The sample is small and repeatedly reused, and the excerpt does not establish out-of-sample performance, robustness across markets, or the effects of execution assumptions.

Key ideas

  • The model uses six normalized technical and volume features to estimate the chance of a near-term upward move.
  • It retrains on a recent sample every fixed number of bars after a warm-up period.
  • Entries combine a probability threshold with a short moving-average trend filter and a cooldown.
  • Exits use a weakening probability signal and a percentage-based trailing stop.
  • Reported backtest metrics are not independently validated and do not establish robustness.

Tags

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