Generic Classifier
systemic:core-gclsMachine learningInputs
| Name | Type | Description |
|---|---|---|
| N Estimators | Whole number | The number of weak learners (small decision trees) in the AdaBoost ensemble. |
| Decision Tree Max Depth | Whole number | The maximum depth of each decision tree (weak learner) in the ensemble. |
| Random State | Whole number | The seed for random number generation, which makes results reproducible. |
| Classifier type | Choice from a list | The machine learning algorithm used for classification. |
| Feature matrix | Several number series | The matrix of feature values the model learns from, with one row per bar and one column per feature. |
| Target labels | Whole number series | The binary class labels (0 or 1) that the model learns to predict. |
Outputs
| Name | Type | Description |
|---|---|---|
| Feature Importances | Several number series | The relative contribution of each feature to the model used on each bar. |
| Prediction | Whole number series | The predicted class (0 or 1) for each bar, calculated only from data of earlier bars. |
| Prediction Confidence | Number series | The model's certainty in each prediction, as a probability from 0 to 1. |
Cost
0.463 + 0.0515·n + 0.000000522·n² credits for n bars, rounded up. The marks are each plan's limit of bars.
"The best signal is not the one that predicts the market—it's the one that knows when it's confident enough to act."
The Generic Classifier module uses ensemble machine learning to turn your indicators into predictive signals. It learns patterns from historical data to classify market conditions or predict trend direction. It also returns a confidence score, so you can filter out weak predictions.
Why Machine Learning for Trading?
Traditional technical analysis relies on fixed rules, such as "if RSI > 70, sell." But markets change. What worked in 2015 may not work in 2025.
Machine learning offers a different approach:
- Learn patterns from historical data rather than hardcoding rules
- Combine multiple signals into a single coherent prediction
- Quantify confidence so you know when to trust the signal
- Identify feature importance to understand what's driving predictions
This module brings machine learning to your Systemic strategies without any coding.
For background on ML in finance, see Investopedia: Machine Learning in Trading.
Core Concept: AdaBoost Ensemble
The module uses AdaBoost (Adaptive Boosting), an ensemble method that combines many "weak learners" into one "strong learner."
How AdaBoost Works
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#3498db'}}}%%
flowchart TD
subgraph TRAINING["🎓 Training Phase"]
W1["Start: Equal weights<br/>for all samples"]
L1["Train Weak Learner #1<br/>(Decision Stump)"]
E1["Find misclassified<br/>samples"]
W2["Increase their<br/>weights"]
L2["Train Learner #2<br/>(focuses on hard cases)"]
LN["Repeat N times..."]
end
subgraph ENSEMBLE["🗳️ Final Ensemble"]
V["Weighted Vote<br/>of all learners"]
end
subgraph OUTPUT["📤 Outputs"]
P["Prediction<br/>(0 or 1)"]
C["Confidence<br/>(0.0 to 1.0)"]
end
W1 --> L1 --> E1 --> W2 --> L2 --> LN --> V
V --> P
V --> C
style TRAINING fill:#ecf0f1,stroke:#bdc3c7
style ENSEMBLE fill:#d5f5e3,stroke:#27ae60
style OUTPUT fill:#d6eaf8,stroke:#3498db
Why "Adaptive"?
Each new weak learner focuses on the samples that the previous learners got wrong:
| Round | Focus |
|---|---|
| 1 | All samples equally |
| 2 | Harder samples weighted more |
| 3 | Even more focus on persistent errors |
| ... | Continues adapting |
| N | Final ensemble from all learners |
Mathematical Foundation
The Weak Learner: Decision Tree
Each weak learner is a small decision tree. Its depth is set by the Decision Tree Max Depth input. Depth 1 is a decision stump: a tree with just one split, the setup AdaBoost was designed for. A higher depth lets each learner capture more feature interactions, with a higher risk of overfitting:
Where:
- is a single feature value
- is the optimal threshold found during training
Sample Weight Update
After each round , misclassified samples get higher weights:
| Symbol | Meaning |
|---|---|
| Weight of sample | |
| Learner weight (higher if more accurate) | |
| True label (+1 or -1) | |
| Learner's prediction |
Ensemble Prediction
The final prediction combines all learners:
Each learner's vote is weighted by its accuracy. Better learners have more influence.
Data Flow
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#3498db'}}}%%
flowchart LR
subgraph INPUTS["📥 Inputs"]
F["Feature Matrix<br/>(Multiple indicators)"]
T["Target Labels<br/>(Historical outcomes)"]
end
subgraph SPLIT["✂️ Walk-Forward"]
TR["Train: labeled rows before t"]
TE["Predict: row t"]
end
subgraph MODEL["🧠 AdaBoost"]
AB["Ensemble of<br/>Decision Stumps"]
end
subgraph OUTPUTS["📤 Outputs"]
P["Prediction"]
C["Confidence"]
FI["Feature<br/>Importance"]
end
F --> SPLIT
T --> SPLIT
TR --> AB
TE --> AB
AB --> P & C & FI
style INPUTS fill:#fadbd8,stroke:#e74c3c
style MODEL fill:#d5f5e3,stroke:#27ae60
style OUTPUTS fill:#d6eaf8,stroke:#3498db
Preventing Look-Ahead Bias: every bar
tis predicted by a model trained only on rows strictly beforet. The model is retrained every 50 labeled bars, not on every bar. Between retrainings the latest model is used, so it never sees the bar it predicts. Predictions start once 2 labeled rows exist. Learn more about look-ahead bias.
Missing Data
A bar with an incomplete feature row (data gap, weekend, holiday, or a feature that has not started yet) gets no prediction: Prediction, Prediction Confidence and that row of Feature Importances are all empty on that bar. A feature column that has no value in any training row is left out of that training. The model trains on the other columns, and the Feature Importance of the excluded column is empty (not zero).
Understanding the Outputs
1. Prediction
A walk-forward series: one binary classification result per bar. Each result uses only data from earlier bars.
| Value | Meaning |
|---|---|
| 1 | Positive class (e.g., "bullish", "buy", "trend continues") |
| 0 | Negative class (e.g., "bearish", "sell", "trend reverses") |
2. Confidence Score
How certain the model is about its prediction.
| Confidence | Interpretation | Suggested Action |
|---|---|---|
| 0.90+ | Very high confidence | Strong signal |
| 0.70–0.90 | Moderate confidence | Valid signal |
| 0.55–0.70 | Low confidence | Consider filtering out |
| 0.50–0.55 | Near coin-flip | Model is uncertain |
3. Feature Importance
Which inputs contributed most to the model's decisions:
%%{init: {'theme': 'base'}}%%
pie showData title Example Feature Importance
"RSI" : 42
"MACD Histogram" : 28
"Volume Change" : 18
"Price ROC" : 12
Why this matters:
- Validate intuition — Are important features driving decisions?
- Reduce noise — Remove low-importance features
- Discover patterns — Sometimes unexpected features dominate
Trading Applications
Application 1: Trend Direction Prediction
Train the classifier to predict whether price will be higher or lower in the future:
| Input Features | Target Label Definition |
|---|---|
| RSI, MACD, ATR, Volume | 1 if Close[t+5] > Close[t], else 0 |
Workflow in Systemic:
- Connect technical indicators to the Feature Matrix
- Create target labels from price comparisons
- Chart the prediction signals or use them in further logic
Application 2: Regime Classification
Classify market conditions:
| Market State | Label | Indicators Used |
|---|---|---|
| Trending | 1 | ADX > 25, ATR rising |
| Range-bound | 0 | ADX < 20, ATR stable |
Application 3: Signal Filtering
Use confidence scores to filter signals from other modules:
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#3498db'}}}%%
flowchart TD
Signal["Raw Signal<br/>(e.g., Golden Cross)"]
GCLS["Generic Classifier"]
Check{"Confidence > 0.65?"}
Execute["✅ Keep Signal"]
Skip["⏭️ Drop Signal"]
Signal --> GCLS
GCLS --> Check
Check -->|Yes| Execute
Check -->|No| Skip
style Execute fill:#27ae60,color:#fff
style Skip fill:#e74c3c,color:#fff
Configuration Guide
| Parameter | Description | Typical Range |
|---|---|---|
| N Estimators | Number of weak learners to combine | 50–200 |
| Decision Tree Max Depth | Complexity of each learner | 1–3 |
| Random State | Seed for reproducibility | Any whole number from 1 |
Parameter Selection Tips
| Goal | N Estimators | Max Depth |
|---|---|---|
| Fast, simple | 25–50 | 1 |
| Balanced | 50–100 | 1–2 |
| Maximum accuracy | 100–200 | 2–3 |
Warning on Overfitting: More estimators and deeper trees can overfit to historical data. Always check the results on periods the model was not trained on.
Important Considerations
1. No Guarantees
Machine learning identifies patterns in historical data. Markets change. Past performance does not guarantee future results.
2. Garbage In, Garbage Out
The quality of predictions depends entirely on:
- Relevance of features — Use meaningful indicators
- Quality of labels — Define targets carefully
- Sufficient history — More data generally helps
3. Combine with Risk Management
Never rely solely on ML predictions. Use proper:
- Position sizing
- Stop losses
- Portfolio diversification
Further Reading
- Ensemble Methods Explained — Accessible introduction
- Investopedia: Look-Ahead Bias — Critical concept for backtesting
- Machine Learning in Trading — Overview and applications
Data Alignment and Input Handling
The Feature Matrix comes from a Make Matrix module. Rows are bars and columns are your
connected features. Row t holds the feature values of bar t. The Generic Classifier does not
realign the rows.
Feature Matrix Structure
| Bar | Feature 1 (RSI) | Feature 2 (MACD) | Feature 3 (ATR) |
|---|---|---|---|
| t=0 | 45.2 | 0.05 | 1.2 |
| t=1 | 52.1 | 0.12 | 1.4 |
| t=2 | 68.3 | 0.18 | 1.1 |
| ... | ... | ... | ... |
| t=n (latest bar) | 55.7 | -0.03 | 1.3 |
Alignment Requirements
| Scenario | Behavior |
|---|---|
| Target Labels and Feature Matrix have different row counts | The module returns an error; the counts must be equal |
| A feature is missing on some bars | That cell is empty; see Missing Data above. No value is filled in |
Best Practices
- Use enough history: More rows generally improve training
- Match periods first: Build the Feature Matrix from series that already have the same period
- Check alignment: Make sure all Make Matrix inputs share a period before you connect them
Indicator Assessment
The following chart evaluates the Generic Classifier across key dimensions:
%%{init: {"themeVariables": {"quadrant1Fill": "#e8f5e9", "quadrant2Fill": "#e3f2fd", "quadrant3Fill": "#fff3e0", "quadrant4Fill": "#fce4ec"}}}%%
quadrantChart
title Generic Classifier Assessment
x-axis Low Complexity --> High Complexity
y-axis Low Popularity --> High Popularity
quadrant-1 High Popularity & Complex
quadrant-2 High Popularity & Simple
quadrant-3 Low Popularity & Simple
quadrant-4 Low Popularity & Complex
GCLS - Stocks: [0.72, 0.48]
GCLS - Crypto: [0.70, 0.55]
Dimension Breakdown
| Dimension | Stocks | Crypto | Notes |
|---|---|---|---|
| Popularity | 4.8/10 | 5.5/10 | Growing adoption, but still niche compared to traditional indicators |
| Reliability | 5/10 | 4.5/10 | Highly dependent on feature quality and training data; markets are non-stationary |
| Complexity | 7.2/10 | 7.0/10 | Requires ML understanding; feature engineering is critical |
| Versatility | 8/10 | 8/10 | Can be applied to any binary classification task across asset classes |
| Recent Interest | 7/10 | 8/10 | Surging interest as ML becomes more accessible |
- Popularity: Machine learning classifiers are growing, but are still less common than traditional indicators in retail trading.
- Reliability: Results depend strongly on feature selection, data quality and market regime changes. Past performance does not guarantee future results.
- Complexity: You need to understand ensemble methods and feature selection, and avoid pitfalls such as overfitting and look-ahead bias.
- Versatility: Can predict trend direction, classify regimes and filter signals for any asset class.
- Recent Interest: Strong growth in quant trading, especially for crypto, where traditional analysis may be less effective.