Skip to content

πŸ“Š Trading Data Analyser - A powerful tool for analyzing Binance trade data. Computes ROI, PnL, Sharpe Ratio & generates automated reports. πŸš€

Notifications You must be signed in to change notification settings

Prathameshsci369/TradingDataAnalyser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Trading Data Analyser πŸ“ŠπŸš€

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..


πŸ“Œ Features

βœ… 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.


πŸ“ Project Structure

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

πŸš€ Installation & Setup

πŸ”Ή Step 1: Clone the Repository

git clone https://github.com/Prathameshsci369/TradingDataAnalyser.git
cd TradingDataAnalyser

πŸ”Ή Step 2: Create a Virtual Environment (Optional)

python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

πŸ”Ή Step 3: Install Dependencies

pip install -r requirements.txt

πŸ”ΉStep 4: Unzip file

Befor 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.

πŸ“Œ How to Run the Project

πŸ”Ή 1. Run the Main Pipeline

python scripts/main.py

This will clean data, compute financial metrics, rank portfolios, and generate results.

πŸ”Ή 2. Perform Exploratory Data Analysis (EDA)

python scripts/eda.py

This will generate visual insights like:

  • ROI Distribution
  • Risk vs Return Analysis
  • Win Rate vs Total Positions
  • Portfolio Growth Over Time

πŸ”Ή 3. Generate the Trading Report (PDF)

python scripts/generate_report.py

The final report will be saved in:

reports/trading_report.pdf

πŸ“Š Key Financial Metrics Calculated

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

πŸ“Œ Example Output (top_portfolios.csv)

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

πŸ“Œ Visual Insights Generated

πŸ”Ή 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/

πŸ›  Future Improvements

βœ… 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


πŸ“Œ Contributing

We welcome contributions! If you'd like to improve the analysis, add new features, or fix bugs, follow these steps:

  1. Fork the repository.
  2. Create a new branch (feature-new-analysis).
  3. Commit your changes (git commit -m "Added new feature")
  4. Push to GitHub (git push origin feature-new-analysis)
  5. Submit a Pull Request! πŸŽ‰

πŸ“œ License

This project is licensed under the MIT License. You are free to use, modify, and distribute this project with proper attribution.


πŸ“ž Contact

πŸ”Ή GitHub: Prathameshsci369
πŸ”Ή Email: prathameshsci963@gmail.com


πŸš€ Ready to analyze your trading data? Let's get started!

πŸ”₯ Star the repo if you found this useful! 🌟
πŸ”„ Fork & contribute to make it even better! πŸš€


About

πŸ“Š Trading Data Analyser - A powerful tool for analyzing Binance trade data. Computes ROI, PnL, Sharpe Ratio & generates automated reports. πŸš€

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages