Top Related Projects
Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
An Algorithmic Trading Library for Crypto-Assets in Python
Portfolio analytics for quants, written in Python
bt - flexible backtesting for Python
Python Backtesting library for trading strategies
Python library for backtesting trading strategies & analyzing financial markets (formerly pythalesians)
Quick Overview
Jesse is an advanced cryptocurrency trading framework designed for algorithmic traders. It provides a robust platform for backtesting, paper trading, and live trading strategies across various exchanges. Jesse aims to simplify the process of developing and deploying trading bots while offering powerful features for strategy optimization and risk management.
Pros
- Comprehensive backtesting capabilities with detailed performance metrics
- Supports multiple exchanges and trading pairs
- Offers both paper trading and live trading modes
- Extensive documentation and active community support
Cons
- Steep learning curve for beginners in algorithmic trading
- Limited to cryptocurrency markets only
- Requires Python programming knowledge to create custom strategies
- May have higher system requirements for complex strategies or large datasets
Code Examples
- Defining a simple trading strategy:
from jesse.strategies import Strategy
import jesse.indicators as ta
class SimpleMovingAverageCrossover(Strategy):
def should_long(self) -> bool:
return self.indicators['SMA20'] > self.indicators['SMA50']
def should_short(self) -> bool:
return self.indicators['SMA20'] < self.indicators['SMA50']
def go_long(self):
self.buy = self.position.qty = 1
def go_short(self):
self.sell = self.position.qty = 1
def update_indicators(self):
self.indicators['SMA20'] = ta.sma(self.candles, 20)
self.indicators['SMA50'] = ta.sma(self.candles, 50)
- Configuring a backtest:
from jesse.config import config
from jesse import research
config['app']['trading_mode'] = 'backtest'
config['app']['backtest_start_date'] = '2020-01-01'
config['app']['backtest_finish_date'] = '2021-01-01'
routes = [
('Binance', 'BTC-USDT', '4h', 'SimpleMovingAverageCrossover'),
]
research.backtest(routes, chart=True, tradingview=True)
- Running a live trading session:
from jesse.modes import live_mode
live_mode.run()
Getting Started
- Install Jesse:
pip install jesse
- Create a new project:
jesse make-project myproject
cd myproject
- Configure your strategy and routes in
routes.py
:
routes = [
('Binance', 'BTC-USDT', '1h', 'MyStrategy'),
]
- Run a backtest:
jesse backtest
- Start live trading (after configuring exchange credentials):
jesse live
Competitor Comparisons
Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
Pros of Lean
- More comprehensive and feature-rich platform for algorithmic trading
- Supports multiple asset classes (stocks, forex, crypto, options, futures)
- Larger community and ecosystem with extensive documentation
Cons of Lean
- Steeper learning curve due to its complexity
- Requires more setup and configuration
- Less focused on simplicity and ease of use for beginners
Code Comparison
Jesse:
@property
def hyperparameters(self):
return [
{'name': 'stop_loss', 'type': int, 'min': 1, 'max': 20, 'default': 10},
{'name': 'take_profit', 'type': int, 'min': 1, 'max': 20, 'default': 10},
]
Lean:
public override void Initialize()
{
SetStartDate(2013, 10, 07);
SetEndDate(2013, 10, 11);
SetCash(100000);
AddEquity("SPY", Resolution.Minute);
}
Jesse focuses on simplicity and ease of use, with a Python-based approach that's more accessible to beginners. Lean offers a more comprehensive platform with support for multiple asset classes and languages, but requires more setup and has a steeper learning curve. Jesse's code example shows a straightforward way to define hyperparameters, while Lean's initialization demonstrates its more complex, but flexible, approach to algorithm setup.
An Algorithmic Trading Library for Crypto-Assets in Python
Pros of Catalyst
- Built specifically for the Secret Network, offering privacy-preserving smart contract functionality
- Supports multiple programming languages including Rust, Go, and JavaScript
- Provides a comprehensive development environment with built-in testing and deployment tools
Cons of Catalyst
- Limited to the Secret Network ecosystem, reducing flexibility for other blockchain platforms
- Steeper learning curve due to the complexity of privacy-preserving computations
- Smaller community and ecosystem compared to more general-purpose trading frameworks
Code Comparison
Jesse:
from jesse.strategies import Strategy
class MyStrategy(Strategy):
def should_long(self):
return self.close > self.sma(10)
def should_short(self):
return self.close < self.sma(10)
Catalyst:
use cosmwasm_std::{Deps, Env, StdResult};
use secret_toolkit::viewing_key::{ViewingKey, ViewingKeyStore};
pub fn query_balance(deps: Deps, env: Env, address: String, key: String) -> StdResult<Balance> {
ViewingKey::check(deps.storage, &address, &key)?;
// Query balance logic here
}
Portfolio analytics for quants, written in Python
Pros of QuantStats
- Focuses on performance analysis and risk metrics for quantitative trading strategies
- Provides extensive visualization tools for portfolio analysis
- Integrates well with pandas DataFrames for easy data manipulation
Cons of QuantStats
- Limited to post-trade analysis and doesn't provide trading execution capabilities
- Requires external data sources for historical price data
- Less suitable for live trading scenarios compared to Jesse
Code Comparison
Jesse:
from jesse.routes import router
router.set_routes([
('Binance', 'BTC-USDT', '4h', 'ExampleStrategy'),
])
QuantStats:
import quantstats as qs
qs.extend_pandas()
returns = pd.read_csv('returns.csv', index_col='date', parse_dates=True)
qs.reports.html(returns, output='stats.html')
Jesse is designed for creating and backtesting trading strategies, while QuantStats focuses on analyzing trading performance and generating reports. Jesse provides a more comprehensive framework for strategy development and execution, whereas QuantStats excels in post-trade analysis and visualization of trading results.
bt - flexible backtesting for Python
Pros of bt
- More comprehensive backtesting and analysis tools, including performance metrics and risk management features
- Supports a wider range of financial instruments, including stocks, options, and futures
- More active development and larger community support
Cons of bt
- Steeper learning curve due to more complex API and features
- Less focus on cryptocurrency trading compared to Jesse
- Requires more setup and configuration for basic use cases
Code Comparison
Jesse:
from jesse.strategies import Strategy
class MyStrategy(Strategy):
def should_long(self):
return self.close > self.sma(10)
def should_short(self):
return self.close < self.sma(10)
bt:
import bt
def sma_cross(data):
sma_fast = data.rolling(10).mean()
sma_slow = data.rolling(20).mean()
return sma_fast > sma_slow
strategy = bt.Strategy('SMA_Cross',
[bt.algos.SelectWhere(sma_cross),
bt.algos.WeighEqually(),
bt.algos.Rebalance()])
Both Jesse and bt offer backtesting capabilities for trading strategies, but they cater to different user needs and preferences. Jesse is more focused on cryptocurrency trading with a simpler API, while bt provides a more comprehensive set of tools for various financial instruments and advanced analysis.
Python Backtesting library for trading strategies
Pros of Backtrader
- More mature and established project with a larger community
- Supports a wider range of asset classes, including stocks and futures
- Offers more advanced features like multi-timeframe analysis and live trading
Cons of Backtrader
- Steeper learning curve due to its complexity and extensive features
- Less focus on cryptocurrency trading compared to Jesse
- Documentation can be overwhelming for beginners
Code Comparison
Jesse:
from jesse.strategies import Strategy
class MyStrategy(Strategy):
def should_long(self):
return self.close > self.sma(10)
def should_short(self):
return self.close < self.sma(10)
Backtrader:
import backtrader as bt
class MyStrategy(bt.Strategy):
def __init__(self):
self.sma = bt.indicators.SimpleMovingAverage(period=10)
def next(self):
if self.data.close > self.sma:
self.buy()
elif self.data.close < self.sma:
self.sell()
Both frameworks allow for creating custom strategies, but Jesse's syntax is more concise and focused on cryptocurrency trading. Backtrader offers more flexibility and supports a wider range of assets, but requires more boilerplate code.
Python library for backtesting trading strategies & analyzing financial markets (formerly pythalesians)
Pros of finmarketpy
- Broader focus on financial market analysis, including backtesting, market data analysis, and trading strategies
- More comprehensive documentation and examples for various financial market applications
- Integrates with popular data providers like Bloomberg and Quandl
Cons of finmarketpy
- Less specialized for cryptocurrency trading compared to Jesse
- May have a steeper learning curve due to its broader scope
- Not as actively maintained, with fewer recent updates
Code Comparison
Jesse:
from jesse.strategies import Strategy
class MyStrategy(Strategy):
def should_long(self):
return self.close > self.sma(10)
def should_short(self):
return self.close < self.sma(10)
finmarketpy:
from finmarketpy.backtest import Backtest
from finmarketpy.economics import Market
market = Market(market_data=['EURUSD'])
strategy = Backtest(market_data=market, strategy_parameters={})
strategy.calculate_strategy()
Both libraries offer ways to implement trading strategies, but Jesse is more focused on cryptocurrency trading with a simpler API, while finmarketpy provides a more general framework for financial market analysis and backtesting across various asset classes.
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
Algo-trading was ðµâð«, we made it ð¤©
Jesse
Jesse is an advanced crypto trading framework that aims to simplify researching and defining YOUR OWN trading strategies.
Why Jesse?
In short, Jesse is more accurate than other solutions, and way more simple. In fact, it is so simple that in case you already know Python, you can get started today, in matter of minutes, instead of weeks and months.
Here you can read more about Jesse's features and why you should use it.
Getting Started
Head over to the "getting started" section of the documentation. The documentation is short yet very informative.
Resources
- â¡ï¸ Website
- ð Documentation
- ð¥ Youtube channel (screencast tutorials)
- ð Help center
- ð¬ Discord community
- ð¤ Jesse Guru
Screenshots
Check out Jesse's Youtube channel for tutorials that go through example strategies step by step.
Here are a few screenshots just to get you excited:
Backtest results:
Example strategy code:
class SMACrossover(Strategy):
@property
def slow_sma(self):
return ta.sma(self.candles, 200)
@property
def fast_sma(self):
return ta.sma(self.candles, 50)
def should_long(self) -> bool:
# Fast SMA above Slow SMA
return self.fast_sma > self.slow_sma
def should_short(self) -> bool:
# Fast SMA below Slow SMA
return self.fast_sma < self.slow_sma
def should_cancel_entry(self) -> bool:
return False
def go_long(self):
# Open long position and use entire balance to buy
qty = utils.size_to_qty(self.balance, self.price, fee_rate=self.fee_rate)
self.buy = qty, self.price
def go_short(self):
# Open short position and use entire balance to sell
qty = utils.size_to_qty(self.balance, self.price, fee_rate=self.fee_rate)
self.sell = qty, self.price
def update_position(self):
# If there exist long position, but the signal shows Death Cross, then close the position, and vice versa.
if self.is_long and self.fast_sma < self.slow_sma:
self.liquidate()
if self.is_short and self.fast_sma > self.slow_sma:
self.liquidate()
Live trading (requires live plugin):
What's next?
You can see the project's roadmap here. Subscribe to our mailing list at jesse.trade to get the good stuff as soon they're released. Don't worry, We won't send you spamâPinky promise.
How to contribute
Thank you for your interest in contributing to the project. The best way to contribute is by participating in the community and helping other users.
You can also contribute by submitting bug reports and feature requests or writing code (submitting PRs) which can be incorporated into Jesse itself.
In that case, here's what you need to know:
- Before starting to work on a PR, please reach out to make sure it aligns with the project's roadmap and vision.
- If your PR makes changes to the source code, please make sure to add unit tests. If you're not sure how to do that, just check out some of the already existing tests.
First, you need to install Jesse from the repository instead of PyPi:
# first, make sure that the PyPi version is not installed
pip uninstall jesse
# now install Jesse from the repository
git clone https://github.com/jesse-ai/jesse.git
cd jesse
pip install -e .
Now every change you make to the code will be affected immediately.
After every change, make sure your changes did not break any functionality by running tests:
pytest
Disclaimer
This software is for educational purposes only. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS. Do not risk money that you are afraid to lose. There might be bugs in the code - this software DOES NOT come with ANY warranty.
Top Related Projects
Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
An Algorithmic Trading Library for Crypto-Assets in Python
Portfolio analytics for quants, written in Python
bt - flexible backtesting for Python
Python Backtesting library for trading strategies
Python library for backtesting trading strategies & analyzing financial markets (formerly pythalesians)
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