CTHULU TNT v2.0
Trading-Native Transformer - A purpose-built neural architecture for financial time-series prediction.
Model Overview
CTHULU TNT (Trading-Native Transformer) v2.0 is a novel neural architecture designed from first principles specifically for financial market prediction. Unlike general-purpose language models adapted for trading, every component is engineered for market dynamics.
Key Innovations
| Innovation | Description |
|---|---|
| Temporal-Causal Attention | Strict causality with learned temporal decay across micro, trend, and macro timescales |
| Volatility-Adaptive Temperature | Attention softmax temperature adapts to market volatility in real-time |
| Mixture of Experts (MoE) | 3 specialized experts for trending, ranging, and volatile market regimes |
| Integrated Risk Prediction | SL/TP as first-class model outputs, not external calculations |
| Trading-Specific Embeddings | Custom embeddings for price levels, session timing, and market structure |
Model Card
| Metric | Value |
|---|---|
| Model ID | cthulu-tnt-v2.0 |
| Architecture | Trading-Native Transformer |
| Parameters | 401,248 |
| Model Size (Q8) | ~392 KB |
| Sequence Length | 500 bars |
| Input Features | 27 (OHLCV + Indicators + Sentiment + Time) |
| Inference Latency | <5ms (CPU with AVX2) |
| Throughput | >200 predictions/sec |
Architecture
INPUT [Batch, 500, 27]
β
βββ Price Embedding (5 β 32)
βββ Indicator Embedding (10 β 32)
βββ Sentiment Embedding (7 β 16)
βββ Time Embedding (5 β 16)
β
βΌ
Combined: 96 dimensions (d_model)
β
ββββββββ΄βββββββ
β TRANSFORMER β Γ 3 layers
β BACKBONE β
β β’ Pre-LN β
β β’ 4 heads β
β β’ RoPE β
β β’ SwiGLU β
ββββββββ¬βββββββ
β
ββββββββ΄βββββββ
β MIXTURE OF β
β EXPERTS β
β β’ Trend β
β β’ Range β
β β’ Volatile β
ββββββββ¬βββββββ
β
ββββββββ΄βββββββ
β OUTPUT β
β HEADS β
βββββββββββββββ€
β Direction β β 3-class (long/short/neutral)
β Price Delta β β 3 horizons (1, 5, 20 bars)
β Confidence β β Bayesian uncertainty
β Risk β β SL/TP in ATR units
βββββββββββββββ
Parameter Breakdown
| Component | Parameters |
|---|---|
| Embeddings | 672 |
| Transformer Layers (Γ3) | 360,000 |
| MoE Router | 288 |
| Expert FFNs (Γ3) | 39,168 |
| Output Heads | 960 |
| Layer Norms | 160 |
| TOTAL | 401,248 |
Performance Targets
| Metric | Target | Description |
|---|---|---|
| Direction Accuracy | >52% | Better than random baseline |
| Profit Factor | >1.3 | Gross profit / gross loss |
| Sharpe Ratio | >0.5 | Risk-adjusted return |
| Max Drawdown | <15% | Worst peak-to-trough |
| Calibration Error | <5% | Confidence matches accuracy |
Usage
Python Integration
from cthulu.model.arch_2.0 import CthulhuTNT, CthulhuConfig
# Load model
config = CthulhuConfig(seq_len=500)
model = CthulhuTNT(config)
model.load("path/to/model.ctml")
# Prepare input: [batch, seq_len, features]
# Features: OHLCV (5) + Indicators (10) + Sentiment (7) + Time (5) = 27
input_data = prepare_market_data(...)
# Inference
outputs = model.forward(input_data)
# Results
direction = outputs['direction_probs'] # [batch, 3] - long/neutral/short
price_delta_1 = outputs['price_delta_1'] # [batch, 1] - 1-bar ahead
price_delta_5 = outputs['price_delta_5'] # [batch, 1] - 5-bars ahead
price_delta_20 = outputs['price_delta_20'] # [batch, 1] - 20-bars ahead
confidence = outputs['confidence'] # [batch, 1] - prediction confidence
stop_loss = outputs['stop_loss'] # [batch, 1] - suggested SL in ATR
take_profit = outputs['take_profit'] # [batch, 1] - suggested TP in ATR
MetaTrader 5 Integration
from cthulu.model.arch_2.0.mt5_bridge import MT5TNTBridge
# Initialize bridge
bridge = MT5TNTBridge(
model_path="model.ctml",
symbol="EURUSD",
timeframe="H1"
)
# Get trading signal
signal = bridge.get_signal()
# Returns: direction, confidence, stop_loss, take_profit
# Full prediction with all outputs
prediction = bridge.predict()
Input Features
Price Features (5)
- Open, High, Low, Close, Volume (normalized)
Technical Indicators (10)
- RSI (14-period)
- MACD (12, 26, 9)
- ADX (14-period)
- ATR (14-period)
- Bollinger Band %B
- Stochastic %K, %D
- Volume MA ratio
- Price momentum
- Volatility ratio
Sentiment Features (7)
- Market regime indicator
- Trend strength
- Volatility state
- Session activity
- Correlation factor
- News sentiment (if available)
- Order flow imbalance
Time Features (5)
- Hour of day (cyclical)
- Day of week (cyclical)
- Session indicator (Asian/London/NY)
Training
Data Requirements
- Minimum: 5 years of M1/M5 data
- Recommended: 10+ years across multiple pairs
- Format: OHLCV with timestamps
Training Command
cd model/arch_2.0
python train_tnt.py \
--epochs 100 \
--batch-size 64 \
--learning-rate 0.0001 \
--data-source mt5 \
--symbols EURUSD,GBPUSD,USDJPY \
--dashboard
Training Configuration
TrainingConfig(
learning_rate=1e-4,
weight_decay=0.01,
batch_size=32,
epochs=100,
lr_schedule="warmup_cosine",
warmup_epochs=5,
early_stopping=True,
patience=10
)
File Format: CTML
Custom binary format optimized for trading models:
CTML File Structure:
βββ Header (64 bytes)
β βββ Magic: "CTML"
β βββ Version
β βββ Section offsets
β βββ CRC64 checksum
βββ Metadata (JSON)
β βββ Architecture config
β βββ Training info
β βββ Performance metrics
βββ Feature Config (JSON)
β βββ Input normalization
β βββ Output specifications
βββ Tensor Index
β βββ Name, shape, dtype, offset
βββ Tensor Data
βββ Quantized weights (Q8_0)
Deployment Options
| Option | Use Case | Performance |
|---|---|---|
| Python FastAPI | Development, prototyping | Good |
| C/C++ Library | Production, low-latency | Best |
| WebAssembly | Browser deployment | Good |
| MT5 DLL | Direct MetaTrader integration | Best |
Comparison with Other Models
| Model | Params | Latency | Trading-Native | Risk Output |
|---|---|---|---|---|
| CTHULU TNT v2.0 | 401K | <5ms | β Yes | β Yes |
| TimeGPT | 200M | ~100ms | β No | β No |
| Chronos | 710M | ~500ms | β No | β No |
| PatchTST | 1M | ~10ms | β No | β No |
| Informer | 10M | ~50ms | β No | β No |
CTHULU Advantages
- Purpose-Built: Every component designed for trading, not adapted
- Low Latency: Sub-5ms inference enables real-time trading
- Compact: 401K params vs millions in generic models
- Risk-Aware: Native SL/TP prediction, not post-hoc calculation
- Regime-Adaptive: MoE handles different market conditions
Limitations & Risks
β οΈ Trading Financial Instruments Carries Substantial Risk
- Model predictions are probabilistic, not certain
- Past performance does not guarantee future results
- Always use proper risk management
- Test thoroughly on demo accounts before live trading
- The authors are not responsible for trading losses
Known Limitations
- Requires quality data preprocessing
- Performance may degrade in extreme market conditions
- Not designed for HFT (sub-millisecond) applications
- Sentiment features require external data sources
Citation
@software{cthulu_tnt_2026,
title = {CTHULU TNT: Trading-Native Transformer},
author = {Shakil, Ali A. and Artifact Research},
year = {2026},
version = {2.0.0},
url = {https://huggingface.co/amuzetnoM/CTHULU}
}
License
AGPL-3.0 - See LICENSE
Links
- Repository: github.com/amuzetnoM/cthulu
- Documentation: Model Docs
- Training Guide: TRAINING_GUIDE.md
Built on the Gladius Architectural Mandate
πΎ CTHULU - Autonomous Trading Intelligence
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
π
Ask for provider support