Convert Figma logo to code with AI

jesse-ai logojesse

An advanced crypto trading bot written in Python

5,509
707
5,509
7

Top Related Projects

9,430

Lean Algorithmic Trading Engine by QuantConnect (Python, C#)

An Algorithmic Trading Library for Crypto-Assets in Python

Portfolio analytics for quants, written in Python

2,172

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

  1. 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)
  1. 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)
  1. Running a live trading session:
from jesse.modes import live_mode

live_mode.run()

Getting Started

  1. Install Jesse:
pip install jesse
  1. Create a new project:
jesse make-project myproject
cd myproject
  1. Configure your strategy and routes in routes.py:
routes = [
    ('Binance', 'BTC-USDT', '1h', 'MyStrategy'),
]
  1. Run a backtest:
jesse backtest
  1. Start live trading (after configuring exchange credentials):
jesse live

Competitor Comparisons

9,430

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.

2,172

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 Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README


Jesse

Algo-trading was 😵‍💫, we made it 🤩

Jesse

PyPI Downloads Docker Pulls GitHub coverage


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

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:

image

Example strategy code:

image

Live trading (requires live plugin):

image

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.