Go to website
Candle import, strategy creation, backtesting, reports & optimization.
I keep getting "InsufficentMargin" or "NegativeBalance".
InsufficentMargin will happen in futures mode and NegativeBalance in spot mode. Do you have multiple routes? Then you need to make sure that each route only uses a fraction of your capital / available margin. An example would be: self.capital / fraction_to_use fraction_to_use should equal the weight you want to assign the route. The sum of all fraction_to_use mustn't exceed 1. To assign the same amount to all routes you can set fraction_to_use to the number of routes. Do you
Can I create a grid-bot or do market-making?
Yes and no. Jesse wasn't originally made to do grid trading or market-making. It's possible though to do it by adding and removing from a position.
Can I go short and long at the same time?
No. You can add and remove from an existing position in update_position though.
Can I trade multiple pairs at once?
Yes! Jesse has been built to support trading multiple pairs at once. All you need to do is simply define multiple trading routes in your routes.py file. Read the documentation page about routes for details and examples. Additionally, you can use the data of any other symbol (even multiple) while trading a certain symbol. For example, you can trade ETH-USD but also have access to price data of BTC-USD. Read the documentat
Why can I open a position only after candles close and not immediately?
Before you continue reading take a look at the flowchart of Jesse and the explanation about the "live" price. Question already answered? No? No problem. Let's dive into it. Jesse starts its workflow after a fully formed candle, like seen in the flow chart. In that sense, you can't do something "immediately". There is only the most recent candle. The whole candle concept in trading and the whole concept of trading strategies are based on aggregated pr
Why does the optimization take so long?
The optimization mode is parallelized so it runs one backtest per available CPU. This means the fewer CPUs the slower the optimization. The time it takes is exactly the same as the backtest duration multiplied by the number of iterations divided by the number of CPUs. The shown ETA is just a very very rough estimation. The actual duration it takes for a solution varies depending on the complexity of the strategy, timeframe and many more variables. See "What is a good DNA ?" for more information.
My strategy isn't working / trading like it should. What can I do?
Are you certain you set the right Routes and have the right version of your strategy uploaded? It's important to be structured here: Be sure to use clear naming and versioning of your strategies. If you are sure Jesse is running the strategy (version) you intended, let's check more things you can do: Use the --debug command in backtesting to have Jesse print the things that happen behind the scenes. Check the conditions for validity. Especially custo
I keep getting CandleNotFoundInDatabase.
No candle for ... is present in the database. Try importing candles. This means Jesse couldn't load the required candles from the database. The reasons could be: You actually didn't import candles for that exchange and symbol yet. You have a typo in the symbol or exchange. You accidentally connected to the wrong / another database. This might happen if you use the environment variables to set the database configuration. Not enough candles for ... Try running "jesse import-candles
Where do I add the API keys for the exchange?
The candle API endpoints of exchanges are public. This means for the candle import and therefore backtesting you don't need an account or API credentials. So you don't need to add them anywhere. This will only be necessary if you start using the live trade plugin.
I keep getting InvalidStrategy.
"Looks like the structure of your strategy directory is incorrect. Make sure to include the strategy INSIDE the init.py file". In this case, Jesse couldn't initiate your strategy. There are three possibilities: Make sure you are working in the correct Jesse project directory - to make sure your changes actually are at the right place. Make sure the class name and folder name of your strategy are the same. This often happens during copy&paste of a strategy (folder) without adjusting th
How do I start the bot?
This question indicates that you aren't entirely familiar yet, what Jesse is. It's not a bot you just fire up and it starts printing magic money. It's a framework enabling you to easily code, (back)test and optimize strategies. With the paid live trade plugin you then can run those strategies on the live market. Ok, how do I start now? Code (or find) a strategy. Backtest and optimize it until you are sure it's a profitable one. Buy the live plugin to take it live. Make sure to start wi
Why doesn't Jesse's indicator match TradingView's values?
There are multiple explanations for this. Different exchanges might have different ohlcv values. Especially volume differs. Are you comparing the same exchange? Consider Spot != Futures. Are you comparing different timeframes by accident? (Custom) Implementations of indicators on TradingView might use different source types or formulas. Compare the formula and parameters used. (Jesse's indicator Source Code, [Talib's S
Can I access tick / trade data?
No. Currently, the finest data Jesse offers are 1m candles.
Is my exchange supported?
backtesting / importing candles For backtesting / importing candles Jesse currently supports the exchanges listed here. As the candle data are available without authentication you can use them, even if you don't have an account for them. live mode The live mode will try to support as many exchanges as possible in long term but will prioritize by popularity. See the currently supported exchanges [here](https://docs
What's the best way to plot custom indicators written for Jesse?
You can use Jupyter Notebooks for that. See an example here.
What specs should my server have?
For the optimization mode: The more CPUs the more parallel backtests run so the optimization is faster. VPS is great, but use a good hoster, because the very cheap ones reduce the speed of the vCores or use very old hardware with low speed. Dedicated ones aren't necessary if you use a good hoster. For live trading: One CPU is sufficient for live mode. Just make sure it's a good hoster, with high uptime, reliable hardware, good performance, and a good internet connection. A minimum of 2 GB RA
Can I scan the market and select pairs dynamically?
Yes and no. Currently, Jesse doesn't support scanning the whole market to filter pairs by certain indicators. It's possible though to have multiple routes and turning each strategy/route on or off depending on certain conditions using shared_vars.
What is a good DNA?
Often the question is asked what a good DNA is or when the optimize mode came to a "solution". You don't have to actually wait until the progress reached 100%. An indicator that the algorithm found a solution is when DNA's start to be similar / patterns emerge. Be aware that this is also the point where overfitting most probably already happened. You might want to test earlier DNAs before that point. Also, a DNA obtained by the optimize mode is never live-trading ready. Overfitting is a big dang
Can I backtest rebalancing strategies?
No. Currently, Jesse doesn't support rebalancing strategies.
Can't we speed up the optimization with GPU? Do I need a GPU for my server?
GPU isn't suited for all types of problems and calculations. In many situations, a CPU is actually faster. That's the reason a PC has both. Jesse only utilizes the CPU. You can work on performance though. Make sure to use the @cached property and wherever possible Numba or Cython.
Jesse's backtest results differ from backtesting with another tool. What's the reason?
Is the strategy tested the same in both tools? Consider everything: indicators (same parameter, source type and formulas), stop-losses, take-profit and commission fees. The formulas for metrics calculation might differ: Some backtest tools use stock market settings for the metrics (255 vs 365 trading days) leading to different metric values, to name one example. Additionally, some backtest tools can have the so-called lookahead / repainting issue. This means they access future candle dat
I get " Uncaught Exception: IndexError: invalid index to scalar variable.". What's wrong?
This often happens if you use an indicator without sequential=True, leading to it just returning one value, while the operations you are doing expect an array.
Can I trade one timeframe, but run update_position() in another timeframe?
Yes but it's a little tricky. You need to set your routes to trade the lower timeframe so that the update_position() (and all other main methods of your strategy) is based on that timeframe. Then, you'd have to check if it's time to execute the strategy, only if the time has come for that bigger timeframe to close. There are multiple ways to check if the bigger timeframe has closed, but here's an example for trading with (any) lower timeframe and the 4h timeframe as the targeted bigger tim
How can I access the "live" price?
The smallest timeframe available in Jesse is 1 minute. There are multiple reasons for that. Finer historical price data aren't (easily) available. Historical (free) APIs for crypto prices normally offer 1m as the smallest timeframe. The database size would grow a lot using finer data. (That's the reasons those finer data are often premium) The only reason to have finer data would be high-frequency trading or orderbook strategies which Jesse currently isn't suited for. So is there a live p
I got "ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()"
This means you are doing a comparsion with an (nd)array and a single value. In case of self.candles, self.get_candles and indicators returning named tuples. You have a multi-dimensional array and need to also select the dimension: More info: [https://www.w3schools.com/python/numpy/numpy_array_indexing.asp](https://www.w3schools.com/python/numpy/numpy_array_
Can you code / write me a strategy or indicator?
Jesse currently doesn't offer official coding services for indicators or strategies. Jesse has a big community though. Make sure to visit the Discord from Jesse. You can ask there and maybe someone even has it coded. If you pay a third party, be aware that there is no guarantee on quality and functionality of their work.
I got "InvalidShape".
This means you didn't set your quantity and price in a way Jesse expected. You can find examples of how to do it for both single and multiple entries or exits https://docs.jesse.trade/docs/strategies/entering-and-exiting.html#entering-and-or-exiting-at-multiple-points.
I changed the warmup_candles_num config. Why do my indicator values change?
Many indicators have so-called memory meaning that past values influence all futures values. You can find a good explanation with graphics here: https://ta-lib.org/d_api/ta_setunstableperiod.html. So if you change the warmup_candles_num amount the indicator values might change.