This visualization panel is applicable to the visualization of the backtest results
of a series of time-testing strategies with only different parameters and all other backtesting
conditions are the same, which integrates the post based on the visualization of the backtest results
of the n-parameter strategy with parallel coordinates, a better evaluation function of the capital curve, and the results of the strategy visualization echarts
charts enhancement (new version), which contains quite a comprehensive visualization and analysis functions.
Function
- The drop-down box in the upper left corner allows you to select the strategy parameters. You can view the overall
backtesting
results for all parameters before selecting them, and you can additionally view thebacktesting results
corresponding to the parameter after selecting it. - The navigation bar on the left is used to switch between different functions. The pages with the suffix “-chart” show charts, which are described in detail in the Parallel coordinates-based visualization of n-parameter strategy
backtesting results
and the strategy visualizationecharts
chart enhancement (new version). The page with “-table” suffix shows the underlying data of the corresponding chart, and has filtering, sorting and other functions.
Effect display
The diagrams of each function are as follows (in order from top to bottom):
How to use
Install the dash,dash_bootstrap_components,dash_extensions libraries.
Download and extract the code files to a separate folder.
Modify the global variables in the configuration file config.py and the contents of the five functions, be careful not to modify the number of parameters of the function, if you need other information can add global variables. For specific modification requirements, please refer to the comments in the file and the following instructions:
The return value of
get_param_name
should be shaped like [‘n’, ‘m’], which is used for interface display and charting.The return value of
get_param_list
should look like [[200, 2.0], [200, 3.0], [300, 2.0], [300, 3.0]], which is used to provide the options in the drop-down box.The return value of
get_all_data_df
should be aDataFrame
, for which the requirements are consistent with those in the post Parallel coordinates-based visualization ofbacktesting
results for n-parameter strategies.The return value of
get_param_data_df
should be aDataFrame
, and the requirements for it are consistent with those in the post Strategy Visualizationecharts
Chart Enhancements (new version).The return value of get_plot_info should be
PlotInfo
, the requirements for which are the same as in the post strategy visualizationecharts
chart enhancement (new version).
Note the source of the following functions, if they do not exist, you can import or copy and paste them into the corresponding file:
from plot import … The source of the functions in the new version of
echarts
Charting for Strategic Visualization is in the Appendix.from statistic import … The source of the function in is the better funding curve evaluation function.
Run app.py and visit http://127.0.0.1:8050/ with your browser.
Note
The file_system_store folder that is automatically generated in the code folder is used to cache data and will be automatically deleted after the program exits.
appendice
1 | def get_kline_df(df, plot_info): |
file structure
app.py
1 | # -*- coding: utf-8 -*- |
config.py
1 | # -*- coding: utf-8 -*- |
page.py
1 | # -*- coding: utf-8 -*- |
utility.py
1 | # -*- coding: utf-8 -*- |