Systemicbeta

Generic Classifier

systemic:core-gclsMachine learning

Inputs

NameTypeDescription
N EstimatorsWhole numberThe number of weak learners (small decision trees) in the AdaBoost ensemble.
Decision Tree Max DepthWhole numberThe maximum depth of each decision tree (weak learner) in the ensemble.
Random StateWhole numberThe seed for random number generation, which makes results reproducible.
Classifier typeChoice from a listThe machine learning algorithm used for classification.
Feature matrixSeveral number seriesThe matrix of feature values the model learns from, with one row per bar and one column per feature.
Target labelsWhole number seriesThe binary class labels (0 or 1) that the model learns to predict.

Outputs

NameTypeDescription
Feature ImportancesSeveral number seriesThe relative contribution of each feature to the model used on each bar.
PredictionWhole number seriesThe predicted class (0 or 1) for each bar, calculated only from data of earlier bars.
Prediction ConfidenceNumber seriesThe model's certainty in each prediction, as a probability from 0 to 1.

Cost

53
credits per run
1,000
bars

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:

RoundFocus
1All samples equally
2Harder samples weighted more
3Even more focus on persistent errors
...Continues adapting
NFinal 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:

h(x)={1,if xj≥θ0,otherwiseh(x) = \begin{cases} 1, & \text{if } x_j \geq \theta \\ 0, & \text{otherwise} \end{cases}

Where:

  • xjx_j is a single feature value
  • θ\theta is the optimal threshold found during training

Sample Weight Update

After each round tt, misclassified samples get higher weights:

wi(t+1)=wi(t)⋅e−αt⋅yi⋅ht(xi)w_i^{(t+1)} = w_i^{(t)} \cdot e^{-\alpha_t \cdot y_i \cdot h_t(x_i)}
SymbolMeaning
wiw_iWeight of sample ii
αt\alpha_tLearner weight (higher if more accurate)
yiy_iTrue label (+1 or -1)
ht(xi)h_t(x_i)Learner's prediction

Ensemble Prediction

The final prediction combines all learners:

H(x)=sign(∑t=1Tαt⋅ht(x))H(x) = \text{sign}\left(\sum_{t=1}^{T} \alpha_t \cdot h_t(x)\right)

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 t is predicted by a model trained only on rows strictly before t. 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.

ValueMeaning
1Positive class (e.g., "bullish", "buy", "trend continues")
0Negative class (e.g., "bearish", "sell", "trend reverses")

2. Confidence Score

How certain the model is about its prediction.

ConfidenceInterpretationSuggested Action
0.90+Very high confidenceStrong signal
0.70–0.90Moderate confidenceValid signal
0.55–0.70Low confidenceConsider filtering out
0.50–0.55Near coin-flipModel 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 FeaturesTarget Label Definition
RSI, MACD, ATR, Volume1 if Close[t+5] > Close[t], else 0

Workflow in Systemic:

  1. Connect technical indicators to the Feature Matrix
  2. Create target labels from price comparisons
  3. Chart the prediction signals or use them in further logic

Application 2: Regime Classification

Classify market conditions:

Market StateLabelIndicators Used
Trending1ADX > 25, ATR rising
Range-bound0ADX < 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

ParameterDescriptionTypical Range
N EstimatorsNumber of weak learners to combine50–200
Decision Tree Max DepthComplexity of each learner1–3
Random StateSeed for reproducibilityAny whole number from 1

Parameter Selection Tips

GoalN EstimatorsMax Depth
Fast, simple25–501
Balanced50–1001–2
Maximum accuracy100–2002–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


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

BarFeature 1 (RSI)Feature 2 (MACD)Feature 3 (ATR)
t=045.20.051.2
t=152.10.121.4
t=268.30.181.1
............
t=n (latest bar)55.7-0.031.3

Alignment Requirements

ScenarioBehavior
Target Labels and Feature Matrix have different row countsThe module returns an error; the counts must be equal
A feature is missing on some barsThat cell is empty; see Missing Data above. No value is filled in

Best Practices

  1. Use enough history: More rows generally improve training
  2. Match periods first: Build the Feature Matrix from series that already have the same period
  3. 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

DimensionStocksCryptoNotes
Popularity4.8/105.5/10Growing adoption, but still niche compared to traditional indicators
Reliability5/104.5/10Highly dependent on feature quality and training data; markets are non-stationary
Complexity7.2/107.0/10Requires ML understanding; feature engineering is critical
Versatility8/108/10Can be applied to any binary classification task across asset classes
Recent Interest7/108/10Surging 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.
Rendering diagrams...
© 2026 WanoLabs. All rights reservedBeta v0.1.5