A robust data analysis pipeline for Binance trade history, designed to process, analyze, and visualize trading data. This project calculates key financial metrics, ranks portfolios, generates visual insights, and provides an automated trading report in PDF format..
β
Data Processing & Cleaning β Parses trade history, validates data, and removes inconsistencies.
β
Financial Metrics Calculation β Computes ROI, PnL, Sharpe Ratio, MDD, Win Rate, and more.
β
Portfolio Ranking β Scores and ranks top-performing portfolios based on profitability.
β
Exploratory Data Analysis (EDA) β Generates key insights using Seaborn & Matplotlib visualizations.
β
Automated PDF Reports β Summarizes key findings, top traders, and recommendations.
β
Modular & Scalable β Supports future enhancements like real-time data streaming.
TradingDataAnalyser/
βββ data/ # Raw & processed trade history files
β βββ trade_history.csv # Input trade history data
β
βββ logs/ # Logs for debugging & tracking execution
βββ output/ # Stores final CSV results & analysis
βββ reports/ # Generated reports & visualizations
β βββ plots/ # Trading insights visualizations
β βββ trading_report.pdf # Automated PDF report
βββ scripts/ # Core Python scripts
β βββ main.py # Main execution pipeline
β βββ trading_analyzer.py # Data processing & analysis module
β βββ eda.py # Exploratory Data Analysis (EDA) script
β βββ generate_report.py # Automated PDF report generator
βββ README.md # Project documentation
βββ requirements.txt # Required Python dependencies
βββ .gitignore # Ignore unnecessary files in Git
git clone https://github.com/Prathameshsci369/TradingDataAnalyser.git
cd TradingDataAnalyserpython3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtBefor the run code unzip the data_compressed.tar.xz file. That are contain one folder and that folder are have the one sample csv file for testing.
python scripts/main.pyThis will clean data, compute financial metrics, rank portfolios, and generate results.
python scripts/eda.pyThis will generate visual insights like:
- ROI Distribution
- Risk vs Return Analysis
- Win Rate vs Total Positions
- Portfolio Growth Over Time
python scripts/generate_report.pyThe final report will be saved in:
reports/trading_report.pdf
| Metric | Description |
|---|---|
| ROI (%) | Return on Investment (Profit % based on initial capital) |
| PnL ($) | Total Profit/Loss generated |
| Sharpe Ratio | Risk-adjusted return metric |
| MDD (Max Drawdown) | Largest peak-to-trough portfolio loss |
| Win Rate (%) | Percentage of profitable trades |
| Profit Factor | Ratio of total profit to total loss |
| Port_ID | ROI (%) | PnL ($) | Sharpe Ratio | MDD | Win Rate (%) | Total Positions | Profit Factor |
|---|---|---|---|---|---|---|---|
| 3826087012661391104 | 27.03 | 532.66 | 9.7 | -7.6e+21 | 91.3 | 69 | 16.08 |
| 4029506971304830209 | 6.04 | 2413.65 | 23.81 | 0.0 | 60.0 | 5 | 1899.27 |
| 4037282461943784704 | 0.5 | 4760.37 | 24.78 | 0.0 | 78.16 | 174 | 2.98 |
πΉ Histogram of ROI (%)
πΉ Risk vs Return: Sharpe Ratio vs ROI Scatter Plot
πΉ Win Positions vs Total Positions (Bar Chart)
πΉ Portfolio Growth Over Time (Line Chart)
All visualizations are saved in:
reports/plots/
β
Automate real-time trading data fetching from Binance API
β
Integrate Streamlit for interactive visual dashboards
β
Expand to include multi-asset portfolio analysis
β
Machine Learning predictions for trade optimization
We welcome contributions! If you'd like to improve the analysis, add new features, or fix bugs, follow these steps:
- Fork the repository.
- Create a new branch (
feature-new-analysis). - Commit your changes (
git commit -m "Added new feature") - Push to GitHub (
git push origin feature-new-analysis) - Submit a Pull Request! π
This project is licensed under the MIT License. You are free to use, modify, and distribute this project with proper attribution.
πΉ GitHub: Prathameshsci369
πΉ Email: prathameshsci963@gmail.com
π₯ Star the repo if you found this useful! π
π Fork & contribute to make it even better! π