RazHadas commited on
Commit
d9b155f
Β·
verified Β·
1 Parent(s): 76317bb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +71 -12
README.md CHANGED
@@ -1,12 +1,71 @@
1
- ---
2
- title: Quant Connect JSON Analysis
3
- emoji: πŸš€
4
- colorFrom: red
5
- colorTo: pink
6
- sdk: gradio
7
- sdk_version: 5.27.0
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Trading Platform Report Enhancer
2
+
3
+ ## Description
4
+
5
+ This application provides an enhanced interface for analyzing backtest results exported from trading platforms like QuantConnect. Upload one or more backtest JSON files to visualize key performance metrics, compare strategies, analyze trades, and assess risk through various charts and tables.
6
+
7
+ ## Features
8
+
9
+ * **Multi-File Upload:** Analyze multiple backtest reports simultaneously.
10
+ * **Strategy Comparison:** Easily switch between different strategy reports using a dropdown menu.
11
+ * **Comprehensive Overview:** View key performance statistics extracted directly from the report.
12
+ * **Performance Visualization:**
13
+ * Equity Curve
14
+ * Drawdown Curve
15
+ * Normalized Equity vs. Benchmark Comparison
16
+ * **Trade Analysis:**
17
+ * Profit/Loss Distribution Histogram
18
+ * Trade Duration Distribution Histogram (in days)
19
+ * Table of Closed Trades (sample)
20
+ * **Additional Charts:**
21
+ * Asset Exposure Over Time
22
+ * Portfolio Turnover Over Time
23
+ * **In-Depth Risk Analysis:**
24
+ * Monthly Returns Heatmap
25
+ * Monthly Performance Statistics (Min, Max, Mean, Positive/Negative Months)
26
+ * Annualized Rolling Volatility Plot (3M, 6M, 12M windows)
27
+ * Rolling Volatility Statistics Table
28
+ * Top Drawdown Periods Table
29
+ * **Correlation Analysis:**
30
+ * Correlation Heatmap of daily returns between strategies (and benchmark, if available).
31
+ * Correlation Matrix Table.
32
+
33
+ ## How to Use
34
+
35
+ 1. **Upload Files:** Click the "Upload QuantConnect JSON File(s)" button or drag and drop your `.json` backtest report files onto the area.
36
+ 2. **Processing:** The application will process the files. The status will be updated in the "Processing Status" box.
37
+ 3. **Select Strategy:** Once processing is complete, a dropdown menu labeled "Select Strategy to View" will appear. Choose the strategy report you want to inspect.
38
+ 4. **Navigate Tabs:** Explore the different aspects of the selected strategy's performance and risk using the tabs:
39
+ * **πŸ“Š Overview:** Key summary statistics.
40
+ * **πŸ“ˆ Performance Charts:** Equity, Drawdown, and Benchmark plots.
41
+ * **πŸ’Ή Trade Analysis:** P/L, Duration histograms, and sample trades table.
42
+ * **βš™οΈ Other Charts:** Exposure and Turnover plots.
43
+ * **πŸ”Ž Risk Analysis:** Detailed monthly performance, rolling volatility, and drawdown analysis.
44
+ * **🀝 Correlation:** Heatmap and matrix comparing all uploaded strategies (and benchmark).
45
+
46
+ ## Deployment (Hugging Face Spaces)
47
+
48
+ This application is structured for easy deployment on Hugging Face Spaces:
49
+
50
+ 1. **Create a Space:** Go to [Hugging Face Spaces](https://huggingface.co/new-space) and create a new Space.
51
+ 2. **Select SDK:** Choose "Gradio" as the Space SDK.
52
+ 3. **Upload Files:** Upload the following files to the root of your Space repository:
53
+ * `app.py` (Main application script)
54
+ * `utils.py` (Helper functions)
55
+ * `processing.py` (File processing logic)
56
+ * `risk_analysis.py` (Risk calculation logic)
57
+ * `plotting.py` (Plot generation logic)
58
+ * `requirements.txt` (Python dependencies)
59
+ * `README.md` (This file)
60
+ 4. **Launch:** Hugging Face will automatically install the dependencies from `requirements.txt` and run `app.py`. Your application should become available shortly.
61
+
62
+ ## Dependencies
63
+
64
+ The required Python packages are listed in `requirements.txt`:
65
+
66
+ ```text
67
+ gradio
68
+ pandas
69
+ plotly
70
+ numpy
71
+ Install them using pip:pip install -r requirements.txtPotential ImprovementsAdd more sophisticated risk metrics (e.g., Sharpe Ratio, Sortino Ratio, VaR, CVaR).Implement interactive elements on charts (e.g., zooming, selecting time ranges).Allow customization of rolling window periods.Add support for other backtesting platform report formats.Improve handling of different 'symbol' formats in trade data.Add