Skip to main content
Technical Deep Dive

How NetTrader's AI Engine Actually Works

From a 24-dimensional ML feature matrix to a Gemini AI Macro Brain and an 8-tier defense shield — this page explains every layer of the strategy that powers your trades.

Triple-LoopFastTree MLGemini AI8-Tier RiskDirection Flip
Core Architecture

The Triple-Loop Framework

Three concurrent loops running at different cadences. Each serves a distinct function: emergency response, rapid ML signal scanning, and deep macro reasoning.

Every 1s
L1

Emergency Loop

Listens to the Telegram Bot for instant human override commands. Processes /panic, /pause, /resume, and /leverage in near-realtime, bypassing all other logic.

Every 15s
L2

ML Reflex Loop

FastTree gradient-boosted model evaluates 24 market features. Outputs directional probabilities for LONG/SHORT. Opens position only if GAP > 8% threshold is met.

Every 30m
L3

Gemini Macro Loop

Calls Gemini 3.1 Pro (with flash fallback) for macro-level market analysis. Determines Fear/Neutral/Greed sentiment, which modulates entry aggressiveness of the ML Loop.

L1 · 1sTelegram Relay
L2 · 15sML Reflex Matrix
L3 · 30mGemini Executive
DecisionEntry / Exit
ML Reflex Engine

24-Dimensional Feature Matrix

The FastTree gradient-boosted model processes 24 carefully engineered features across four orthogonal market dimensions — achieving AUC-ROC > 71% on 6-year out-of-sample data.

Momentum
  • RSI(14)
  • ADX(14)
  • Plus/Minus DI
  • Price vs EMA(200)
  • 4h Momentum
Volatility
  • Bollinger Width
  • Bollinger %B
  • ATR(14) Normalized
  • Volatility24h
  • High-Low Spread
Context
  • VWAP Distance
  • Volume Ratio
  • Market Cap Tier
  • Funding Rate
  • Open Interest Δ
Micro-Anatomy
  • Bid-Ask Spread
  • Order Book Depth
  • Candle Body Ratio
  • Wick Ratio
  • Trade Count Δ
71.4%
AUC-ROC (Long)
6-year out-of-sample validation
8%
GAP Threshold
|P(LONG) - P(SHORT)| required
738K+
Training Rows
Historical tick data processed
Executive Intelligence

Gemini AI Executive Brain

Every 30 minutes, NetTrader consults Google's Gemini AI for a macro-level assessment of market conditions. Sentiment output dynamically modulates the ML engine's entry aggressiveness.

Model Fallback Chain

1
gemini-3.1-pro-preview
Model Fallback Chain
~12s
2
gemini-3.1-flash-preview
Fallback Tier 1
~3s
3
gemini-flash (stable)
Fallback Tier 2
~2s

Sentiment → Action Matrix

😨
Extreme Fear
Block all new entries
😟
Fear
Reduce position sizes by 50%
😐
Neutral
Standard ML signal logic
🤑
Greed
Allow full + aggressive sizing
🚀
Extreme Greed
Max positioning, scalp mode
Capital Protection

8-Tier Defense-In-Depth Risk Shield

While the ML engine seeks alpha, the risk shield protects downside at every stage. Eight independent layers of protection work in parallel to prevent catastrophic loss.

T1

ML Probability Gate

Requires P(LONG) or P(SHORT) > minimum AUC threshold before any trade entry.

T2

GAP Confidence Filter

T3

Margin Safety Guard

T4

Dynamic Stop-Loss

T5

Trailing Stop Activation

T6

Daily Drawdown Pause

T7

Emergency Balance Stop

T8

Human Override (Telegram)

Execution Logic

Seamless Direction Flip Paradigm

When both Gemini and the ML engine agree on a reversal, NetTrader executes a clean, atomic 6-step position flip — no manual intervention needed.

1
01

Detect Signal Reversal

ML outputs opposite direction with GAP > threshold.

2
02

Confirm with Gemini Macro

Gemini sentiment aligns with or permits the reversal.

3
03

Close Existing Position

Current position market-closed at best available price.

4
04

Cool-Down Wait

Configurable minimum interval before re-entry to avoid whipsaws.

5
05

Re-calculate Entry

Fresh SL/TP levels computed for new direction.

6
06

Open Opposite Position

New position opened with full sizing logic applied.

Ready to Trade at Machine Speed?

Start with our Weekly Pass — full dashboard access, live ML signal streaming,and one week of professional AI-driven trading.

Architecture | NetTrader