Top Related Projects
Official Documentation for the Binance Spot APIs and Streams
A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges
An advanced crypto trading bot written in Python
A bitcoin trading bot written in node - https://gekko.wizb.it/
Github.com/CryptoSignal - Trading & Technical Analysis Bot - 4,100+ stars, 1,100+ forks
Free, open-source crypto trading bot, automated bitcoin / cryptocurrency trading software, algorithmic trading bots. Visually design your crypto trading bot, leveraging an integrated charting system, data-mining, backtesting, paper trading, and multi-server crypto bot deployments.
Quick Overview
Freqtrade is an open-source cryptocurrency trading bot written in Python. It is designed to support various exchanges and is highly customizable, allowing users to implement their own trading strategies. The bot focuses on simplicity and ease of use while providing powerful features for both beginners and experienced traders.
Pros
- Highly customizable with support for user-defined strategies
- Supports multiple cryptocurrency exchanges
- Active community and regular updates
- Comprehensive documentation and backtesting capabilities
Cons
- Requires some programming knowledge to create custom strategies
- Limited built-in strategies out of the box
- Potential for financial loss if not used carefully
- Learning curve for beginners in cryptocurrency trading
Code Examples
- Creating a simple trading strategy:
from freqtrade.strategy import IStrategy, DecimalParameter
class SimpleMovingAverageStrategy(IStrategy):
INTERFACE_VERSION = 3
timeframe = '5m'
stoploss = -0.1
minimal_roi = {"0": 0.1}
buy_sma = DecimalParameter(10, 100, default=50, space='buy')
sell_sma = DecimalParameter(10, 100, default=50, space='sell')
def populate_indicators(self, dataframe, metadata):
dataframe['sma'] = dataframe['close'].rolling(window=50).mean()
return dataframe
def populate_entry_trend(self, dataframe, metadata):
dataframe.loc[
(dataframe['close'] > dataframe['sma']),
'enter_long'] = 1
return dataframe
def populate_exit_trend(self, dataframe, metadata):
dataframe.loc[
(dataframe['close'] < dataframe['sma']),
'exit_long'] = 1
return dataframe
- Configuring the bot:
from freqtrade.configuration import Configuration
config = Configuration.from_files(['config.json'])
config['stake_amount'] = 100
config['dry_run'] = True
- Running the bot:
from freqtrade.worker import Worker
worker = Worker(config)
worker.run()
Getting Started
- Install Freqtrade:
pip install freqtrade
- Create a configuration file (config.json):
{
"max_open_trades": 3,
"stake_currency": "USDT",
"stake_amount": 100,
"tradable_balance_ratio": 0.99,
"fiat_display_currency": "USD",
"dry_run": true,
"exchange": {
"name": "binance",
"key": "your_exchange_key",
"secret": "your_exchange_secret"
},
"strategy": "SimpleMovingAverageStrategy"
}
- Run the bot:
freqtrade trade -c config.json
Competitor Comparisons
Official Documentation for the Binance Spot APIs and Streams
Pros of binance-spot-api-docs
- Comprehensive documentation for Binance Spot API
- Regularly updated with the latest API changes and features
- Provides examples and code snippets in multiple programming languages
Cons of binance-spot-api-docs
- Limited to Binance exchange only
- Requires additional implementation for trading strategies
- No built-in backtesting or optimization tools
Code Comparison
binance-spot-api-docs (Python example):
import requests
response = requests.get('https://api.binance.com/api/v3/ticker/price', params={'symbol': 'BTCUSDT'})
print(response.json())
freqtrade (Python):
from freqtrade.strategy.interface import IStrategy
class MyStrategy(IStrategy):
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe['rsi'] = ta.RSI(dataframe)
return dataframe
The binance-spot-api-docs example shows a simple API request, while freqtrade demonstrates a strategy implementation with technical indicators. freqtrade provides a more comprehensive framework for algorithmic trading, including backtesting and optimization features, while binance-spot-api-docs focuses solely on API documentation and usage examples for the Binance exchange.
A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges
Pros of CCXT
- Supports a vast number of cryptocurrency exchanges (180+)
- Provides a unified API for trading operations across different exchanges
- Offers extensive documentation and examples for various programming languages
Cons of CCXT
- Requires more setup and configuration for automated trading
- Less focused on algorithmic trading strategies out-of-the-box
- May require additional libraries for advanced features like backtesting
Code Comparison
CCXT example:
import ccxt
exchange = ccxt.binance()
ticker = exchange.fetch_ticker('BTC/USDT')
print(ticker['last'])
Freqtrade example:
from freqtrade.strategy.interface import IStrategy
class MyStrategy(IStrategy):
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe['rsi'] = ta.RSI(dataframe)
return dataframe
Key Differences
- CCXT is a library for interacting with various cryptocurrency exchanges, while Freqtrade is a complete trading bot framework
- Freqtrade provides built-in backtesting and hyperoptimization tools, whereas CCXT focuses on exchange connectivity
- CCXT offers more flexibility for custom implementations, while Freqtrade provides a more structured approach to bot development
Use Cases
- CCXT: Ideal for developers building custom trading applications or integrating exchange functionality into existing systems
- Freqtrade: Better suited for traders looking to implement and test trading strategies with minimal coding required
An advanced crypto trading bot written in Python
Pros of Jesse
- Written in Python, allowing for easier integration with data science and machine learning libraries
- Supports backtesting on multiple timeframes simultaneously
- Offers a more flexible and customizable strategy development framework
Cons of Jesse
- Smaller community and fewer available resources compared to Freqtrade
- Less extensive documentation and fewer pre-built strategies
- Steeper learning curve for beginners due to its more advanced features
Code Comparison
Jesse strategy example:
class Strategy(strategies.Strategy):
def should_long(self):
return self.close > self.sma(10)
def should_short(self):
return self.close < self.sma(10)
Freqtrade strategy example:
class MyStrategy(IStrategy):
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe['sma'] = ta.SMA(dataframe, timeperiod=10)
return dataframe
def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(dataframe['close'] > dataframe['sma']),
'buy'] = 1
return dataframe
Both Jesse and Freqtrade are popular algorithmic trading frameworks, but they cater to slightly different audiences. Jesse offers more flexibility and advanced features, while Freqtrade provides a more user-friendly experience with extensive documentation and a larger community.
A bitcoin trading bot written in node - https://gekko.wizb.it/
Pros of Gekko
- Simpler setup and configuration process
- Built-in web interface for easier management
- Supports paper trading out of the box
Cons of Gekko
- Less active development and community support
- Fewer advanced features and strategies
- Limited exchange support compared to Freqtrade
Code Comparison
Gekko (JavaScript):
this.addTalibIndicator('myMACD', 'macd', this.settings);
if (this.talibIndicators.myMACD.result.outMACD > this.settings.thresholds.up) {
this.advice('long');
} else if (this.talibIndicators.myMACD.result.outMACD < this.settings.thresholds.down) {
this.advice('short');
}
Freqtrade (Python):
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe['macd'] = ta.MACD(dataframe['close']).macd()
return dataframe
def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(dataframe['macd'] > self.buy_threshold),
'buy'] = 1
return dataframe
Both projects use technical indicators for trading decisions, but Freqtrade offers more flexibility and a more structured approach to strategy development. Gekko's code is more concise, while Freqtrade's is more modular and easier to extend.
Github.com/CryptoSignal - Trading & Technical Analysis Bot - 4,100+ stars, 1,100+ forks
Pros of Crypto-Signal
- More comprehensive market analysis with multiple technical indicators
- Supports a wider range of exchanges and cryptocurrencies
- Provides alerts and notifications for trading signals
Cons of Crypto-Signal
- Less active development and community support
- Limited backtesting capabilities
- Lacks built-in trading execution features
Code Comparison
Freqtrade (strategy implementation):
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe['rsi'] = ta.RSI(dataframe)
dataframe['macd'], dataframe['signal'], _ = ta.MACD(dataframe['close'])
return dataframe
Crypto-Signal (indicator calculation):
def analyze_rsi(self, historical_data, period_count=14,
hot_thresh=None, cold_thresh=None):
rsi_values = abstract.RSI(historical_data, period_count)
return rsi_values
Both projects use technical analysis libraries, but Freqtrade integrates indicators directly into its strategy framework, while Crypto-Signal calculates indicators separately for analysis and signal generation.
Freqtrade offers a more streamlined approach to strategy development and backtesting, with built-in trading functionality. Crypto-Signal focuses on providing comprehensive market analysis and alerts, requiring additional integration for actual trading execution.
Free, open-source crypto trading bot, automated bitcoin / cryptocurrency trading software, algorithmic trading bots. Visually design your crypto trading bot, leveraging an integrated charting system, data-mining, backtesting, paper trading, and multi-server crypto bot deployments.
Pros of Superalgos
- More comprehensive ecosystem with data mining, charting, and trading capabilities
- Visual programming interface for strategy development
- Extensive documentation and learning resources
Cons of Superalgos
- Steeper learning curve due to its complexity
- Potentially higher system requirements for running the full suite
- Less focus on automated trading compared to Freqtrade
Code Comparison
Superalgos (JavaScript):
function createOrder(context, exchange, market, order) {
const orderId = exchange.createOrder(market, order.type, order.side, order.amount, order.price)
return orderId
}
Freqtrade (Python):
def create_order(self, pair: str, ordertype: str, side: str, amount: float, rate: float, params: Dict = {}):
return self.exchange.create_order(pair, ordertype, side, amount, rate, params)
Both projects handle order creation, but Superalgos uses JavaScript while Freqtrade uses Python. Freqtrade's implementation is more concise and type-hinted, reflecting its focus on automated trading. Superalgos' code is part of a larger ecosystem, potentially offering more flexibility but requiring more setup and understanding of its framework.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Freqtrade is a free and open source crypto trading bot written in Python. It is designed to support all major exchanges and be controlled via Telegram or webUI. It contains backtesting, plotting and money management tools as well as strategy optimization by machine learning.
Disclaimer
This software is for educational purposes only. Do not risk money which you are afraid to lose. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS.
Always start by running a trading bot in Dry-run and do not engage money before you understand how it works and what profit/loss you should expect.
We strongly recommend you to have coding and Python knowledge. Do not hesitate to read the source code and understand the mechanism of this bot.
Supported Exchange marketplaces
Please read the exchange specific notes to learn about eventual, special configurations needed for each exchange.
- Binance
- Bitmart
- BingX
- Bybit
- Gate.io
- HTX (Former Huobi)
- Hyperliquid (A decentralized exchange, or DEX)
- Kraken
- OKX (Former OKEX)
- potentially many others. (We cannot guarantee they will work)
Supported Futures Exchanges (experimental)
- Binance
- Gate.io
- Hyperliquid (A decentralized exchange, or DEX)
- OKX
- Bybit
Please make sure to read the exchange specific notes, as well as the trading with leverage documentation before diving in.
Community tested
Exchanges confirmed working by the community:
Documentation
We invite you to read the bot documentation to ensure you understand how the bot is working.
Please find the complete documentation on the freqtrade website.
Features
- Based on Python 3.10+: For botting on any operating system - Windows, macOS and Linux.
- Persistence: Persistence is achieved through sqlite.
- Dry-run: Run the bot without paying money.
- Backtesting: Run a simulation of your buy/sell strategy.
- Strategy Optimization by machine learning: Use machine learning to optimize your buy/sell strategy parameters with real exchange data.
- Adaptive prediction modeling: Build a smart strategy with FreqAI that self-trains to the market via adaptive machine learning methods. Learn more
- Edge position sizing Calculate your win rate, risk reward ratio, the best stoploss and adjust your position size before taking a position for each specific market. Learn more.
- Whitelist crypto-currencies: Select which crypto-currency you want to trade or use dynamic whitelists.
- Blacklist crypto-currencies: Select which crypto-currency you want to avoid.
- Builtin WebUI: Builtin web UI to manage your bot.
- Manageable via Telegram: Manage the bot with Telegram.
- Display profit/loss in fiat: Display your profit/loss in fiat currency.
- Performance status report: Provide a performance status of your current trades.
Quick start
Please refer to the Docker Quickstart documentation on how to get started quickly.
For further (native) installation methods, please refer to the Installation documentation page.
Basic Usage
Bot commands
usage: freqtrade [-h] [-V]
{trade,create-userdir,new-config,show-config,new-strategy,download-data,convert-data,convert-trade-data,trades-to-ohlcv,list-data,backtesting,backtesting-show,backtesting-analysis,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-markets,list-pairs,list-strategies,list-freqaimodels,list-timeframes,show-trades,test-pairlist,convert-db,install-ui,plot-dataframe,plot-profit,webserver,strategy-updater,lookahead-analysis,recursive-analysis}
...
Free, open source crypto trading bot
positional arguments:
{trade,create-userdir,new-config,show-config,new-strategy,download-data,convert-data,convert-trade-data,trades-to-ohlcv,list-data,backtesting,backtesting-show,backtesting-analysis,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-markets,list-pairs,list-strategies,list-freqaimodels,list-timeframes,show-trades,test-pairlist,convert-db,install-ui,plot-dataframe,plot-profit,webserver,strategy-updater,lookahead-analysis,recursive-analysis}
trade Trade module.
create-userdir Create user-data directory.
new-config Create new config
show-config Show resolved config
new-strategy Create new strategy
download-data Download backtesting data.
convert-data Convert candle (OHLCV) data from one format to
another.
convert-trade-data Convert trade data from one format to another.
trades-to-ohlcv Convert trade data to OHLCV data.
list-data List downloaded data.
backtesting Backtesting module.
backtesting-show Show past Backtest results
backtesting-analysis
Backtest Analysis module.
edge Edge module.
hyperopt Hyperopt module.
hyperopt-list List Hyperopt results
hyperopt-show Show details of Hyperopt results
list-exchanges Print available exchanges.
list-markets Print markets on exchange.
list-pairs Print pairs on exchange.
list-strategies Print available strategies.
list-freqaimodels Print available freqAI models.
list-timeframes Print available timeframes for the exchange.
show-trades Show trades.
test-pairlist Test your pairlist configuration.
convert-db Migrate database to different system
install-ui Install FreqUI
plot-dataframe Plot candles with indicators.
plot-profit Generate plot showing profits.
webserver Webserver module.
strategy-updater updates outdated strategy files to the current version
lookahead-analysis Check for potential look ahead bias.
recursive-analysis Check for potential recursive formula issue.
options:
-h, --help show this help message and exit
-V, --version show program's version number and exit
Telegram RPC commands
Telegram is not mandatory. However, this is a great way to control your bot. More details and the full command list on the documentation
/start
: Starts the trader./stop
: Stops the trader./stopentry
: Stop entering new trades./status <trade_id>|[table]
: Lists all or specific open trades./profit [<n>]
: Lists cumulative profit from all finished trades, over the last n days./forceexit <trade_id>|all
: Instantly exits the given trade (Ignoringminimum_roi
)./fx <trade_id>|all
: Alias to/forceexit
/performance
: Show performance of each finished trade grouped by pair/balance
: Show account balance per currency./daily <n>
: Shows profit or loss per day, over the last n days./help
: Show help message./version
: Show version.
Development branches
The project is currently setup in two main branches:
develop
- This branch has often new features, but might also contain breaking changes. We try hard to keep this branch as stable as possible.stable
- This branch contains the latest stable release. This branch is generally well tested.feat/*
- These are feature branches, which are being worked on heavily. Please don't use these unless you want to test a specific feature.
Support
Help / Discord
For any questions not covered by the documentation or for further information about the bot, or to simply engage with like-minded individuals, we encourage you to join the Freqtrade discord server.
Bugs / Issues
If you discover a bug in the bot, please search the issue tracker first. If it hasn't been reported, please create a new issue and ensure you follow the template guide so that the team can assist you as quickly as possible.
For every issue created, kindly follow up and mark satisfaction or reminder to close issue when equilibrium ground is reached.
--Maintain github's community policy--
Feature Requests
Have you a great idea to improve the bot you want to share? Please, first search if this feature was not already discussed. If it hasn't been requested, please create a new request and ensure you follow the template guide so that it does not get lost in the bug reports.
Pull Requests
Feel like the bot is missing a feature? We welcome your pull requests!
Please read the Contributing document to understand the requirements before sending your pull-requests.
Coding is not a necessity to contribute - maybe start with improving the documentation? Issues labeled good first issue can be good first contributions, and will help get you familiar with the codebase.
Note before starting any major new feature work, please open an issue describing what you are planning to do or talk to us on discord (please use the #dev channel for this). This will ensure that interested parties can give valuable feedback on the feature, and let others know that you are working on it.
Important: Always create your PR against the develop
branch, not stable
.
Requirements
Up-to-date clock
The clock must be accurate, synchronized to a NTP server very frequently to avoid problems with communication to the exchanges.
Minimum hardware required
To run this bot we recommend you a cloud instance with a minimum of:
- Minimal (advised) system requirements: 2GB RAM, 1GB disk space, 2vCPU
Software requirements
- Python >= 3.10
- pip
- git
- TA-Lib
- virtualenv (Recommended)
- Docker (Recommended)
Top Related Projects
Official Documentation for the Binance Spot APIs and Streams
A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges
An advanced crypto trading bot written in Python
A bitcoin trading bot written in node - https://gekko.wizb.it/
Github.com/CryptoSignal - Trading & Technical Analysis Bot - 4,100+ stars, 1,100+ forks
Free, open-source crypto trading bot, automated bitcoin / cryptocurrency trading software, algorithmic trading bots. Visually design your crypto trading bot, leveraging an integrated charting system, data-mining, backtesting, paper trading, and multi-server crypto bot deployments.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot