Views
No views yet
⚠️ CRITICAL DISCLAIMER: These models are for backtesting and research purposes only. They are NOT financial advice and should NOT be used for live trading without extensive validation. Financial markets are non-stationary, and past performance does not guarantee future results.
1from openmedallion_fints.models import LGBMForecaster
2
3model = LGBMForecaster(
4 task='regression', # or 'classification'
5 n_estimators=500,
6 learning_rate=0.05,
7 max_depth=7,
8 num_leaves=31,
9 early_stopping_rounds=50
10)1from openmedallion_fints.models import PatchTSTForecaster
2
3model = PatchTSTForecaster(
4 lookback=64, # Input sequence length
5 horizon=1, # Forecast horizon
6 patch_len=16, # Patch size
7 stride=8, # Patch stride
8 d_model=128, # Model dimension
9 n_heads=4, # Attention heads
10 n_layers=3, # Transformer layers
11 d_ff=256, # Feedforward dimension
12 dropout=0.1
13)1from openmedallion_fints.preprocessing import walk_forward_split
2
3splits = walk_forward_split(
4 df=data,
5 n_splits=5,
6 train_size=0.7,
7 val_size=0.15,
8 test_size=0.15
9)1from openmedallion_fints.eval import calculate_trading_metrics
2
3metrics = calculate_trading_metrics(
4 y_true=actual_returns,
5 y_pred=predicted_returns,
6 benchmark_returns=buy_hold_returns
7)
8# Returns: sharpe_ratio, sortino_ratio, max_drawdown,
9# calmar_ratio, profit_factor, hit_rate| Asset Class | Samples | MAE | RMSE | Direction Accuracy | Hit Rate |
|---|---|---|---|---|---|
| Equities | 27,901 | 0.249 | 0.458 | 87.79% | 87.79% |
| Crypto | 3,650 | 0.991 | 1.299 | 88.57% | 88.57% |
| Forex | 17,614 | 0.096 | 0.118 | 86.22% | 86.22% |
| Commodities | 49,584 | 1.696 | 2.065 | 74.56% | 74.56% |
⚠️ WARNING: Trading metrics show unrealistically high values (infinite returns, NaN drawdowns) indicating the backtest strategy is overly simplified. These are statistical benchmarks only and do NOT represent realistic trading performance. Real-world trading requires proper risk management, transaction costs, slippage, and position sizing.
lgbm_equities_regression.pkl (288KB)lgbm_crypto_regression.pkl (252KB)lgbm_forex_regression.pkl (292KB)lgbm_commodities_regression.pkl (290KB)*_metrics.json file with full evaluation results.1python openmedallion-fints/scripts/train_lgbm.py \
2 --asset-class equities \
3 --split-method expanding \
4 --n-splits 5 \
5 --train-size 0.7 \
6 --val-size 0.15 \
7 --test-size 0.15 \
8 --task regression \
9 --n-estimators 500 \
10 --learning-rate 0.05 \
11 --max-depth 7 \
12 --early-stopping-rounds 50 \
13 --output-dir ./outputs/lgbm_equities1python openmedallion-fints/scripts/train_patchtst.py \
2 --asset-class crypto \
3 --split-method walk_forward \
4 --lookback 64 \
5 --horizon 1 \
6 --patch-len 16 \
7 --stride 8 \
8 --d-model 128 \
9 --n-heads 4 \
10 --n-layers 3 \
11 --batch-size 32 \
12 --epochs 50 \
13 --learning-rate 0.001 \
14 --device cuda \
15 --output-dir ./outputs/patchtst_crypto1from openmedallion_fints.models import LGBMForecaster
2from openmedallion_fints.preprocessing import compute_features
3import pandas as pd
4
5# Load trained model
6model = LGBMForecaster.load("./outputs/lgbm_equities/model.pkl")
7
8# Prepare features
9df = pd.read_parquet("your_ohlcv_data.parquet")
10X, y = compute_features(df, lookback=20, horizon=1)
11
12# Forecast
13predictions = model.predict(X)1@misc{openmedallion-fints-2026,
2 author = {oyi77},
3 title = {OpenMedallion-FinTS: Time-Series Forecasting for Financial Markets},
4 year = {2026},
5 publisher = {HuggingFace},
6 journal = {HuggingFace Model Hub},
7 howpublished = {\url{https://huggingface.co/oyi77/openmedallion-fints}}
8}