Systemicbeta

Binary Classifier

systemic:core-bclsMachine learning

Inputs

NameTypeDescription
N EstimatorsWhole numberThe number of weak learners (decision trees) in the AdaBoost ensemble.
Decision Tree Max DepthWhole numberThe maximum depth of each decision tree in the ensemble.
Random StateWhole numberThe seed for the random number generator, which makes the model reproducible.
Feature matrixSeveral number seriesThe feature series the model learns from: 1 to 10 series, each with one value per bar.
Target labelsWhole number seriesThe class label (0 or 1) the model learns to predict, one per bar.

Outputs

NameTypeDescription
Feature ImportancesSeveral number seriesA matrix with one row per bar and one column per feature: how much each feature weighs in the model used on that bar.
PredictionWhole number seriesThe predicted class (0 or 1) for each bar.
Prediction ConfidenceNumber seriesThe probability the model gives to its predicted class on each bar, from 0 to 1.

Cost

53
credits per run
1,000
bars

0.194 + 0.0518·n + 0.000000546·n² credits for n bars, rounded up. The marks are each plan's limit of bars.

The Binary Classifier module adds machine learning to your strategy with an ensemble method called AdaBoost (Adaptive Boosting). It learns patterns from historical data to predict a yes/no outcome, such as "price goes up" or "price goes down". It returns a prediction and a confidence score.


How AdaBoost Works

AdaBoost is an ensemble learning algorithm that combines many "weak learners" (simple models that are only slightly better than random guessing) into one "strong learner."

flowchart TD
    subgraph Training["Training Phase"]
        D1["Weak Learner 1<br/>(Decision Stump)"]
        D2["Weak Learner 2<br/>(Corrects #1's errors)"]
        D3["Weak Learner 3<br/>(Corrects #2's errors)"]
        DN["... N Learners"]
    end
    
    subgraph Ensemble["Final Ensemble"]
        V["Weighted Vote<br/>of All Learners"]
    end
    
    D1 --> D2 --> D3 --> DN --> V
    
    V --> P["Prediction: 0 or 1"]
    V --> C["Confidence: 0.0 to 1.0"]

The AdaBoost Process

  1. Start with equal weights for all training samples
  2. Train a weak learner (decision stump—a tree with just one split)
  3. Identify misclassified samples and increase their weights
  4. Train the next weak learner focusing on the harder samples
  5. Repeat for N estimators
  6. Combine all learners with weighted voting based on their accuracy

This iterative focus on difficult cases is what gives AdaBoost its name—it adapts to the hardest examples.


Mathematical Foundation

Decision Stump

A decision stump is a one-level decision tree that makes a single binary split:

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 and θ\theta is the optimal threshold.

AdaBoost Weighting

After each round tt, sample weights are updated:

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)}

Where:

  • αt\alpha_t is the learner's weight (based on its accuracy)
  • yiy_i is the true label
  • ht(xi)h_t(x_i) is the learner's prediction

Misclassified samples get higher weights, focusing subsequent learners on the hard cases.

Final Prediction

The ensemble 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)

Training and Prediction Flow

flowchart LR
    subgraph Inputs["Feature Matrix"]
        F1["Feature 1<br/>(e.g., RSI)"]
        F2["Feature 2<br/>(e.g., MACD)"]
        F3["Feature 3<br/>(e.g., Volume)"]
    end
    
    subgraph Labels["Target Labels"]
        T["Historical Outcomes<br/>(0 or 1)"]
    end
    
    subgraph Model["Walk-Forward AdaBoost"]
        TR["Retrain every 50<br/>new samples"]
    end
    
    subgraph Outputs["Predictions"]
        P["Per-Sample<br/>Prediction Series"]
        C["Per-Sample<br/>Confidence Series"]
        FI["Per-Sample<br/>Importance Matrix"]
    end
    
    F1 & F2 & F3 --> TR
    T --> TR
    TR --> P & C & FI

Key Behavior: BCLS walks forward one sample (bar) at a time. The values of prediction, confidence and feature_importance on a bar always come from a model trained only on samples before that bar. This prevents look-ahead bias on every bar, not just the last one. The model is retrained each time 50 new complete, labeled samples are available. Bars in between are predicted with the latest model.


Missing Data

  • A sample with any empty feature cannot be predicted: prediction, confidence and feature_importance are all empty on that bar, and the sample is left out of training.
  • An empty target label only affects training. The sample it belongs to can still be predicted if its features are complete.
  • Mixed calendars (for example, a 24/7 crypto feature next to a business-day feature): weekend and holiday bars are left out of training, so the model does not learn from the crypto feature's weekend values. A matrix built only from business-day series loses nothing.
  • The outputs are empty on the first bars, until at least 2 complete, labeled samples exist before the bar being predicted.
  • feature_importance is for charts only. It is a matrix (one row per bar) and cannot be wired into another module as a series.

Outputs Explained

OutputDescriptionRange
PredictionThe predicted class (0 or 1) for each sample{0, 1}
Prediction ConfidenceProbability assigned to the predicted class[0.0, 1.0]
Feature ImportancesHow much each feature contributed to decisions[0.0, 1.0] per feature

Interpreting Confidence

  • Confidence = 0.95: The model gives its prediction a 95% probability—high conviction
  • Confidence = 0.52: Nearly 50/50—the model is uncertain, treat with caution
  • Confidence thresholds: Many traders only act when confidence exceeds 0.6 or 0.7

Understanding Feature Importance

Feature importance reveals which inputs drive the model's decisions:

pie title Feature Importance Example
    "RSI" : 45
    "MACD Histogram" : 30
    "Volume Delta" : 15
    "Price ROC" : 10

Use this to:

  • Validate your intuition — Are the "right" features being weighted?
  • Simplify your system — Remove low-importance features to reduce noise
  • Discover patterns — Sometimes unexpected features dominate

Practical Applications in Trading

1. Trend Direction Prediction

Train the classifier to predict whether price will be higher or lower N bars ahead:

Feature InputsTarget Label
RSI, MACD, OBV, ATR1 if Close[t+5] > Close[t], else 0

2. Regime Classification

Classify market conditions to select appropriate strategies:

Feature InputsTarget Label
ADX, Volatility, Correlation1 = Trending, 0 = Range-bound

3. Signal Filtering

Use the classifier to filter signals from other indicators:

flowchart TD
    Signal["Raw Buy Signal<br/>(e.g., Golden Cross)"]
    BCLS["Binary Classifier"]
    Confidence{"Confidence > 0.65?"}
    Execute["Keep Signal"]
    Skip["Drop Signal"]
    
    Signal --> BCLS
    BCLS --> Confidence
    Confidence -->|Yes| Execute
    Confidence -->|No| Skip

Configuration Parameters

ParameterDescriptionTypical Value
N EstimatorsNumber of weak learners to combine50–200
Decision Tree Max DepthDepth of each decision tree (1 = stump)1–3
Random StateSeed for reproducibilityAny whole number from 1

Parameter Guidance

  • More estimators generally improve accuracy but take longer to compute
  • Deeper trees can capture more complex patterns but risk overfitting
  • Decision stumps (depth=1) are the classic AdaBoost configuration and work well for noisy financial data

Advantages

  • Resistant to overfitting — Simple weak learners are less likely to memorize noise
  • Handles complex patterns — Ensemble captures non-linear relationships
  • Interpretable — Feature importance reveals what drives predictions
  • Adaptable — Works with any numerical features you can compute

Limitations

  • Requires labeled data — You must define and provide historical target labels
  • Sensitive to outliers — Extreme samples can dominate training
  • No guarantee of future performance — Past patterns may not repeat
  • Black box to some degree — While feature importance helps, exact decision logic is complex

Further Reading


Indicator Assessment

---
config:
  xyChart:
    width: 600
    height: 400
  themeVariables:
    xyChart:
      plotColorPalette: "#1abc9c, #e74c3c"
---
xychart-beta horizontal
    title "Binary Classifier Assessment (Scale: 1-10)"
    x-axis ["Popularity", "Reliability", "Complexity", "Versatility", "Recent Interest"]
    y-axis "Score" 0 --> 10
    bar [5, 5, 7, 8, 8]
    bar [4, 4, 7, 8, 9]

Legend: First bar (teal) = Equities/Forex | Second bar (red) = Cryptocurrency

Dimension Explanations

DimensionEquities/ForexCryptoRationale
Popularity54Machine learning classifiers are less common than traditional indicators. Growing adoption among quant traders. Less established in crypto retail trading.
Reliability54Performance depends heavily on feature selection and market regime. Risk of overfitting. Requires careful validation. Markets may shift, invalidating learned patterns.
Complexity77Requires understanding of machine learning concepts, feature engineering, and proper train/test splits. Not beginner-friendly.
Versatility88Can be applied to any binary classification problem: trend direction, regime detection, signal filtering. Highly adaptable with different feature sets.
Recent Interest89Strong growth in ML-based trading research. Increasing integration in trading platforms. Very high interest in crypto algorithmic trading communities.
Rendering diagrams...
© 2026 WanoLabs. All rights reservedBeta v0.1.5