Decision Trees
By LuxAlgoJun 9, 2026
Decision Trees brings decision trees to the chart as a genuine CART implementation. Each retrain grows a depth-limited tree on the most recent window, labeled by what close did over the following bars; the live bar routes down it and the leaf's prediction plots as an oscillator: P(up) around 50% for Direction, a value around zero for regression. The rules table is the heart: one row per leaf with its conditions, an arrow on the live bar's row.
How to Trade the Decision Trees?
- Prediction above the center: the routed leaf favors upside; center crossings fire the Bullish and Bearish Flip alerts.
- High-confidence guides: on the Direction target, dashed 70%/30% levels isolate the strongest readings for gating other strategies.
- Read the active rule: the arrowed row says why the model leans as it does; if they look like noise, treat the signal that way.
Training uses only closed bars whose forward horizon is realized — no lookahead. The build sits in the Library's machine-learning family.
Decision Trees Settings
- Target (default Direction (Up/Down)): classification, or regression on Forward Return % / Forward Volatility %.
- Impurity Measure (default Gini): split rule for Direction; regression uses variance.
- Prediction Horizon (bars) (default 10), Training Window (samples) (default 200), Retrain Every (bars) (default 10): labeling, sampling, and refit cadence.
- Maximum Depth (default 3) and Minimum Leaf Size (default 20): the readability stopping rules.
- Minimum Gain (default 0) and Split Candidates (default 24): pre-pruning and threshold search granularity.
- High-Confidence Level % (default 70): the dashed guides and alerts.
- Features: RSI (Length 14), Relative Volume (Length 20), Rate of Change % (Length 10), Stochastic %K (Length 14), ATR % (Length 14), all on by default with toggles.
- Show Rules Table (default on) plus location, size, colors.
Frequently Asked Questions
Why a single tree instead of a Random Forest?
Transparency. The Random Forest averages many randomized trees, taming variance but burying logic; this build accepts instability to keep every rule auditable.
How do I fight overfitting?
Depth and leaf size are the levers — shallow trees with generous leaves cannot memorize much. Each extra level doubles the regions available to fit noise; Minimum Gain discards splits that barely improve purity.
Why did the oscillator jump without price moving?
A retrain replaced the tree, and the new structure can route the same features to a different leaf. Longer windows, lower depth, and slower retraining make jumps rarer.
The Library is free. Quant makes it yours.
Pull any concept or indicator into Quant: rebuild it, retune it, or turn it into a backtested strategy of your own.
