開源函式庫

Freqtrade

freqtrade/freqtrade

Crypto trading bot framework with FreqAI ML extension supporting multiple machine learning and deep learning models.

語言 Python資產 crypto市場 spot, derivatives類型 framework

來源與實作起點

下列模型路徑已對照 Freqtrade develop 修訂版 c0a991f (2026-09-24). 這些是示例實作;未測量速度、準確率或交易報酬評分。

官方 FreqAI 指南從 FreqaiExampleStrategy、LightGBMRegressor 與 config_freqai.example.json 入手。示例策略僅供學習與測試,不適用於正式交易。參見 FreqAI.

freqtrade trade --config config_examples/config_freqai.example.json --strategy FreqaiExampleStrategy --freqaimodel LightGBMRegressor --strategy-path freqtrade/templates

先安裝 FreqAI 相依套件並檢查示例設定。將預測用於策略前,須以時間順序資料與交易成本驗證。

基於指標的模板

SampleStrategy
Freqtrade
指標驅動beginner

Template strategy demonstrating basic technical indicator usage for entry/exit signals.

原始碼:freqtrade/templates/sample_strategy.py

機器學習模型(FreqAI)

FreqAI 預測模型用於基於機器學習的價格預測。每個模型都需要透過 Freqtrade 的特徵流水線進行特徵工程。

LightGBMRegressor
Freqtrade
機器學習intermediate

Gradient boosting regression model for price movement prediction using LightGBM.

原始碼:freqtrade/freqai/prediction_models/LightGBMRegressor.py
LightGBMClassifier
Freqtrade
機器學習intermediate

LightGBM classification model for user-defined discrete labels.

原始碼:freqtrade/freqai/prediction_models/LightGBMClassifier.py
XGBoostRegressor
Freqtrade
機器學習intermediate

XGBoost-based regression model for continuous value prediction.

原始碼:freqtrade/freqai/prediction_models/XGBoostRegressor.py
XGBoostClassifier
Freqtrade
機器學習intermediate

XGBoost classification model for user-defined discrete labels.

原始碼:freqtrade/freqai/prediction_models/XGBoostClassifier.py
PyTorchMLPRegressor
Freqtrade
機器學習advanced

Multi-layer perceptron neural network for regression-based price prediction.

原始碼:freqtrade/freqai/prediction_models/PyTorchMLPRegressor.py
PyTorchTransformerRegressor
Freqtrade
機器學習advanced

Transformer architecture for time-series regression using self-attention mechanism.

原始碼:freqtrade/freqai/prediction_models/PyTorchTransformerRegressor.py

強化學習(FreqAI)

基於 Stable Baselines3 構建的強化學習代理。代理透過與環境互動而非標註資料來學習交易決策。

ReinforcementLearner
Freqtrade
強化學習advanced

Reinforcement learning agent using Stable Baselines3 (PPO/A2C/etc.) for trading decisions.

原始碼:freqtrade/freqai/prediction_models/ReinforcementLearner.py

Freqtrade 策略與 FreqAI 模型,演算法參考

SampleStrategy (Freqtrade)
Template strategy demonstrating basic technical indicator usage for entry/exit signals. 原始碼: https://github.com/freqtrade/freqtrade/blob/c0a991f5632cb900075ff2864b6671ed71a319d7/freqtrade/templates/sample_strategy.py.
LightGBMRegressor (Freqtrade)
Gradient boosting regression model for price movement prediction using LightGBM. 原始碼: https://github.com/freqtrade/freqtrade/blob/c0a991f5632cb900075ff2864b6671ed71a319d7/freqtrade/freqai/prediction_models/LightGBMRegressor.py.
LightGBMClassifier (Freqtrade)
LightGBM classification model for user-defined discrete labels. 原始碼: https://github.com/freqtrade/freqtrade/blob/c0a991f5632cb900075ff2864b6671ed71a319d7/freqtrade/freqai/prediction_models/LightGBMClassifier.py.
XGBoostRegressor (Freqtrade)
XGBoost-based regression model for continuous value prediction. 原始碼: https://github.com/freqtrade/freqtrade/blob/c0a991f5632cb900075ff2864b6671ed71a319d7/freqtrade/freqai/prediction_models/XGBoostRegressor.py.
XGBoostClassifier (Freqtrade)
XGBoost classification model for user-defined discrete labels. 原始碼: https://github.com/freqtrade/freqtrade/blob/c0a991f5632cb900075ff2864b6671ed71a319d7/freqtrade/freqai/prediction_models/XGBoostClassifier.py.
PyTorchMLPRegressor (Freqtrade)
Multi-layer perceptron neural network for regression-based price prediction. 原始碼: https://github.com/freqtrade/freqtrade/blob/c0a991f5632cb900075ff2864b6671ed71a319d7/freqtrade/freqai/prediction_models/PyTorchMLPRegressor.py.
PyTorchTransformerRegressor (Freqtrade)
Transformer architecture for time-series regression using self-attention mechanism. 原始碼: https://github.com/freqtrade/freqtrade/blob/c0a991f5632cb900075ff2864b6671ed71a319d7/freqtrade/freqai/prediction_models/PyTorchTransformerRegressor.py.
ReinforcementLearner (Freqtrade)
Reinforcement learning agent using Stable Baselines3 (PPO/A2C/etc.) for trading decisions. 原始碼: https://github.com/freqtrade/freqtrade/blob/c0a991f5632cb900075ff2864b6671ed71a319d7/freqtrade/freqai/prediction_models/ReinforcementLearner.py.