File size: 2,660 Bytes
1c681ea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---

language: en
license: mit
tags:
- finance
- trading
- cryptocurrency
- lightgbm
- tabular
- time-series
- quantitative-finance
---


# LGBM Crypto Expected-Value Entry Classifier

## Overview

This model is a **LightGBM-based binary classifier** trained to identify **high-probability long entry points** in cryptocurrency markets based on engineered OHLCV features.

The model outputs a probability representing whether a trade has **positive expected value** over a fixed future horizon, given current market conditions.

It is designed as an **entry signal component**, not a full trading system.

---

## Intended Use

- Identifying high-confidence trade entry points
- Research into ML-driven alpha signals
- Use as a signal input for rule-based or reinforcement-learning trading systems
- Educational and experimental quantitative finance projects

**Not intended for:**
- Direct execution without risk management
- Standalone portfolio management
- Live trading without additional validation

---

## Data

- **Assets:** BTC_USDT, ETH_USDT (Binance spot)
- **Frequency:** 1-minute OHLCV bars
- **Time period:** Historical Binance data (multi-year)
- **Source:** Public Binance data via CryptoDataDownload

---

## Features (high-level)

The model uses engineered, asset-agnostic features including:

- Log returns over multiple horizons
- Rolling volatility estimates
- Moving averages and trend slopes
- ATR-based volatility
- Volume and trade-count z-scores

All features are computed using **only past information** (no leakage).

---

## Labels

The target label represents whether a hypothetical long trade achieves **positive expected value** over a fixed future horizon, accounting for transaction costs.

This is **not** a directional price prediction.

---

## Model Details

- **Model type:** LightGBM Gradient Boosted Trees
- **Objective:** Binary classification (expected value > 0)
- **Loss:** Binary log loss
- **Training style:** Time-based train/validation split
- **Evaluation:** AUC, log loss, walk-forward backtests

---

## Performance Summary

Typical validation metrics (varies by window):

- AUC: ~0.55
- Log loss: ~0.68

Despite modest AUC, the model demonstrates **positive expectancy when thresholded**, consistent with real-world trading signals.

---

## Usage Example

```python

import joblib

import pandas as pd



bundle = joblib.load("lgbm_ev_classifier.joblib")

model = bundle["model"]

feature_cols = bundle["feature_cols"]



# df must already contain engineered features

df["prob"] = model.predict(df[feature_cols])