File size: 1,512 Bytes
37bff14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39ddeb7
37bff14
 
 
 
 
 
 
 
39ddeb7
 
 
37bff14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
06e506c
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
---
license: apache-2.0
tags:
- forex
- trading
- time-series
- classification
- xgboost
- lightgbm
- lstm
---

# OANDA Trading Signal Models

Multi-model classification pipeline predicting BUY / HOLD / SELL signals
for major forex pairs using 10 years of H1 candle data.

## Instruments
USD_CHF

## Granularity
H1 (1-hour candles)

## Model Performance (Test Set)

| Model     | Accuracy | F1 (weighted) | Sharpe Ratio | Return % | Max DD % |
|-----------|----------|--------------|--------------|----------|----------|
| xgboost | 0.3895086891225059 | 0.4624705139898039 | 0.0 | 0.0% | 0.0% |
| lightgbm | 0.370521347350354 | 0.4419163108223123 | 0.0 | 0.0% | 0.0% |
| lstm | 0.3868268611885861 | 0.45938959752709685 | -0.476 | -0.0% | -0.0% |

## Usage

```python
from huggingface_hub import hf_hub_download
import joblib

# Download and load XGBoost model
path = hf_hub_download(repo_id="keeprich/oanda-trading-models", filename="models/xgboost/EUR_USD_H1/model.pkl")
model = joblib.load(path)
```

## Features
30 engineered technical features including:
- EMA crossovers (8, 21, 50, 200)
- RSI (7, 14), MACD, Stochastic, Williams %R, CCI, ADX
- Bollinger Bands (width, %B), ATR
- Log returns and lagged returns

## Target
3-class signal: `0=SELL`, `1=HOLD`, `2=BUY`
Based on 4-bar forward return with ±0.15% threshold.

## Training
- Period: 10 years (2016–2026)
- Split: 70% train / 15% val / 15% test (time-ordered, no shuffle)
- Scaling: StandardScaler fitted on train set only

Generated: 2026-07-11