Trading Results Viewer
Overview
The Trading Results Viewer is a comprehensive web interface that allows users to explore individual trades from the QuantifyAI algorithm experiments. It provides an interactive table view of all trades with the ability to view corresponding plot images.
Features
π Interactive Trade Table
- Complete Trade History: View all trades from each experiment
- Color-coded P&L: Green for profits, red for losses
- Formatted Dates: Clean, readable date formatting
- Plot Availability: Visual indicators showing which trades have associated plots
πΌοΈ Plot Viewer
- Click to View: Click any trade row to view the corresponding plot
- Modal Display: Plots open in a full-screen modal overlay
- Keyboard Support: Press ESC to close plots
- Responsive Design: Works on desktop and mobile devices
π Summary Statistics
- Portfolio Summary: Total P&L and win rate
- Trade Statistics: Total trades, winning trades, losing trades
- Visual Cards: Beautiful gradient cards with key metrics
How to Use
Accessing the Viewer
- From Main Page: Go to the main index page and click βView Tradesβ for any experiment
- Direct Links: Each experiment has a dedicated trading results page
Viewing Trades
- Browse the Table: Scroll through all trades in the experiment
- Click a Row: Click any trade row to view the corresponding plot
- Close Plot: Click the X button, click outside the plot, or press ESC
Technical Details
File Structure
TemporalSensitivityAnalysis/
βββ trading_results_continuous_*.csv # Original CSV data
βββ trading_results_continuous_*.html # Generated viewer pages
βββ plots_*_to_*/ # Plot directories
β βββ TICKER_ENTRY_EXECUTION.png # Individual plot files
β βββ ...
βββ ...
Plot Naming Convention
Plots are named using the pattern: {TICKER}_{ENTRY_DATE}_{EXECUTION_DATE}.png
Examples: - ACB_2020-04-23_2021-02-11.png - HIVE_2018-12-19_2021-07-14.png
Generated Files
The viewer generates HTML pages for each experiment: - trading_results_continuous_2018-01-01_to_2025-01-01.html - trading_results_continuous_2018-01-07_to_2025-01-07.html - trading_results_continuous_2018-01-14_to_2025-01-14.html - trading_results_continuous_2018-01-21_to_2025-01-21.html - trading_results_continuous_2018-01-28_to_2025-01-28.html - trading_results_continuous_2018-02-01_to_2025-02-01.html - trading_results_continuous_2018-02-07_to_2025-02-07.html
Regenerating the Viewer
To regenerate the trading results viewer pages:
python trading_results_viewer.pyThis will: 1. Read all CSV files in the TemporalSensitivityAnalysis directory 2. Match trades with their corresponding plot files 3. Generate interactive HTML pages for each experiment 4. Update the main index page with βView Tradesβ links
Browser Compatibility
The viewer is compatible with: - Chrome (recommended) - Firefox - Safari - Edge - Mobile browsers
Dependencies
The viewer uses: - Bootstrap 5.1.3: For responsive design and styling - Bootstrap Icons: For visual elements - Vanilla JavaScript: For interactivity (no additional frameworks required)
Customization
The viewer can be customized by modifying: - trading_results_viewer.py: Main generation script - CSS styles in the generated HTML files - JavaScript functionality for plot display - Table layout and formatting
Troubleshooting
Plots Not Loading
- Check that plot files exist in the correct directory
- Verify plot naming matches the expected pattern
- Ensure plot files are accessible via web server
Table Not Displaying
- Verify CSV files are properly formatted
- Check that the generation script completed successfully
- Ensure HTML files are being served correctly
Performance Issues
- Large datasets may take time to load
- Consider pagination for very large trade lists
- Optimize plot file sizes if needed