Analyze Jesse backtest results and indicators with clean TradingView charts in jupyter.
This project is a continuation of these two projects: Lightweight Charts for Jesse : https://github.com/Gabri/jupyterlab-lightweight-charts-jesse and Jesse Trades Info : https://github.com/nick-dolan/jesse-trades-info
It leverages the power of lightweight charts TradingView library imported to jupyter to visualize indicators and backtest results in a straightforward and modulable way for improved research.
Main Features:
- Print costumizable candle and indicator series in TV clean charts.
- Feed candles series from jesse database and calculate indicators directly within jupyter or import indicator series from .json file.
- Read backtest json files and display an interactive table of trades that expands to display orders table and show them on chart.
Installation process:
- Copy this repo into the root of your Jesse directory in your server.
- Run Jesse and Jupyter Lab.
- Import candles in Jesse.
- Edit your strategy file like the example to select the indicators you want to save in the self.after method and dump the json files in the self.terminate method.
- Run your backtest.
- Go to jupyter, open the notebook, uncomment and run the first cell to install dependencies you may not have.
- Select your backtest by editing the name file ; select the timeframe you want to look at ; warmup candles and initial balance.
- Select and customize your indicators to plot on the chart in the last notebook cell.
- Run the notebook.
Tips:
- Read the notebook and strategy example to understand how to plot your own stuff nicely.
- Include the methods used in the strategy file in a separate python file or in a new class inherited from Jesse Strategy.
- Read the Lightweight chart documentation to see how to apply styles to your charts: https://tradingview.github.io/lightweight-charts/
- Use the dump functions in the self.after method to analyze running live strategies.
Known issues:
- "Javascript: require is not defined" may pop, just rerun the notebook.
- Candlestick markers on orders may have an offset when using different timeframes than the backtest.
- Jesse natively stores incomplete information on orders such as fees. Expect deviations between backtest results and live.