Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- finance
|
| 6 |
+
- trading
|
| 7 |
+
- cryptocurrency
|
| 8 |
+
- lightgbm
|
| 9 |
+
- tabular
|
| 10 |
+
- time-series
|
| 11 |
+
- quantitative-finance
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# LGBM Crypto Expected-Value Entry Classifier
|
| 15 |
+
|
| 16 |
+
## Overview
|
| 17 |
+
|
| 18 |
+
This model is a **LightGBM-based binary classifier** trained to identify **high-probability long entry points** in cryptocurrency markets based on engineered OHLCV features.
|
| 19 |
+
|
| 20 |
+
The model outputs a probability representing whether a trade has **positive expected value** over a fixed future horizon, given current market conditions.
|
| 21 |
+
|
| 22 |
+
It is designed as an **entry signal component**, not a full trading system.
|
| 23 |
+
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
## Intended Use
|
| 27 |
+
|
| 28 |
+
- Identifying high-confidence trade entry points
|
| 29 |
+
- Research into ML-driven alpha signals
|
| 30 |
+
- Use as a signal input for rule-based or reinforcement-learning trading systems
|
| 31 |
+
- Educational and experimental quantitative finance projects
|
| 32 |
+
|
| 33 |
+
**Not intended for:**
|
| 34 |
+
- Direct execution without risk management
|
| 35 |
+
- Standalone portfolio management
|
| 36 |
+
- Live trading without additional validation
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
## Data
|
| 41 |
+
|
| 42 |
+
- **Assets:** BTC_USDT, ETH_USDT (Binance spot)
|
| 43 |
+
- **Frequency:** 1-minute OHLCV bars
|
| 44 |
+
- **Time period:** Historical Binance data (multi-year)
|
| 45 |
+
- **Source:** Public Binance data via CryptoDataDownload
|
| 46 |
+
|
| 47 |
+
---
|
| 48 |
+
|
| 49 |
+
## Features (high-level)
|
| 50 |
+
|
| 51 |
+
The model uses engineered, asset-agnostic features including:
|
| 52 |
+
|
| 53 |
+
- Log returns over multiple horizons
|
| 54 |
+
- Rolling volatility estimates
|
| 55 |
+
- Moving averages and trend slopes
|
| 56 |
+
- ATR-based volatility
|
| 57 |
+
- Volume and trade-count z-scores
|
| 58 |
+
|
| 59 |
+
All features are computed using **only past information** (no leakage).
|
| 60 |
+
|
| 61 |
+
---
|
| 62 |
+
|
| 63 |
+
## Labels
|
| 64 |
+
|
| 65 |
+
The target label represents whether a hypothetical long trade achieves **positive expected value** over a fixed future horizon, accounting for transaction costs.
|
| 66 |
+
|
| 67 |
+
This is **not** a directional price prediction.
|
| 68 |
+
|
| 69 |
+
---
|
| 70 |
+
|
| 71 |
+
## Model Details
|
| 72 |
+
|
| 73 |
+
- **Model type:** LightGBM Gradient Boosted Trees
|
| 74 |
+
- **Objective:** Binary classification (expected value > 0)
|
| 75 |
+
- **Loss:** Binary log loss
|
| 76 |
+
- **Training style:** Time-based train/validation split
|
| 77 |
+
- **Evaluation:** AUC, log loss, walk-forward backtests
|
| 78 |
+
|
| 79 |
+
---
|
| 80 |
+
|
| 81 |
+
## Performance Summary
|
| 82 |
+
|
| 83 |
+
Typical validation metrics (varies by window):
|
| 84 |
+
|
| 85 |
+
- AUC: ~0.55
|
| 86 |
+
- Log loss: ~0.68
|
| 87 |
+
|
| 88 |
+
Despite modest AUC, the model demonstrates **positive expectancy when thresholded**, consistent with real-world trading signals.
|
| 89 |
+
|
| 90 |
+
---
|
| 91 |
+
|
| 92 |
+
## Usage Example
|
| 93 |
+
|
| 94 |
+
```python
|
| 95 |
+
import joblib
|
| 96 |
+
import pandas as pd
|
| 97 |
+
|
| 98 |
+
bundle = joblib.load("lgbm_ev_classifier.joblib")
|
| 99 |
+
model = bundle["model"]
|
| 100 |
+
feature_cols = bundle["feature_cols"]
|
| 101 |
+
|
| 102 |
+
# df must already contain engineered features
|
| 103 |
+
df["prob"] = model.predict(df[feature_cols])
|