Aperçu
Freqtrade est un bot de trading crypto open-source écrit en Python. Prend en charge le développement de stratégies, le backtesting, l'optimisation des hyperparamètres, et le trading en dry-run ou en direct via 100+ backends d'exchanges (CCXT).
Installation
git clone https://github.com/freqtrade/freqtrade.git
cd freqtrade
uv pip install -e .
Stratégie
from freqtrade.strategy import IStrategy
class MyStrategy(IStrategy):
timeframe = "1h"
minimal_roi = {"0": 0.01}
stoploss = -0.05
def populate_indicators(self, dataframe, metadata):
dataframe["rsi"] = 100 - (100 / (1 + dataframe["close"] / dataframe["close"].shift(14)))
return dataframe
def populate_buy_trend(self, dataframe, metadata):
dataframe.loc[(dataframe["rsi"] < 30) & (dataframe["volume"] > 0), "buy"] = 1
return dataframe
Exécution
freqtrade backtesting --strategy MyStrategy --timerange 20240101-20241231
freqtrade trade --strategy MyStrategy --dry-run