Skip to content

An end-to-end machine learning project analyzing the relationship between Bitcoin market sentiment (Fear & Greed Index) and trader performance. Built predictive models to uncover behavioral trading patterns and optimize decision-making in Web3 trading.

License

Notifications You must be signed in to change notification settings

gaurav9364/Trader-Behavior-Insights-ML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Trader Behavior Insights — Market Sentiment Analysis (Bitcoin)

While others analyze the past, we predict trader behavior using emotion-driven sentiment data.

OVERVIEW

This project explores the relationship between Bitcoin market sentiment (Fear & Greed Index) and trader performance using real trading data. The goal is to uncover how emotions like fear or greed influence profitability and build a predictive model to forecast trader success.

DATASETS LINK

Feer Greed Index: fear_greed_index.csv Columns: timestamp, value (Fear-Greed Index), classification, date Historical Data: historical_data.csv Columns: Account, Coin, Execution Price, Size USD, Side, Timestamp IST, Closed PnL, etc.

DATA CLEANING

  • First item Converted timestamps to datetime format and extracted dates

  • Second item Standardized column names

  • Third item Merged sentiment and trading datasets on the date field

  • Fourth item Created a binary target variable: profitable = 1 if ClosedPnL > 0 else 0

  • Fifth item Encoded categorical columns (Side, Classification)

EXPLORATORY DATA ANALYSIS (EDA)

  • First item Analyzed distribution of Fear-Greed Index and Trader Profitability

  • Second item Compared average profits during Fear vs Greed market phases

  • Third item Visualized correlations and sentiment-based performance

  • Fourth item Observed that traders often perform differently depending on market emotion levels

MACHINE LEARNING MODELING

Models Used:

  • First item Logistic Regression

  • Second item Random Forest Classifier

Features:

fear_greed_index, Size USD, Side_encoded, sentiment_encoded

Target:

profitable

  • First item Logistic Regression:

             Accuracy: ~61.9%
             Key Observation: Performs linearly, basic interpretability
    
  • Second item Random Forest:

             Accuracy: ~74.5%
             Key Observation: Captures non-linear sentiment-performance patterns
    

Top Influencing Factors:

  • First item Fear-Greed Index

  • Second item Trade Size (USD)

  • Third item Side (Buy/Sell)

INSIGHTS

  • First item Market sentiment strongly correlates with trader profitability.

  • Second item Greedy markets tend to have higher volatility and both high profits & losses.

  • Third item Random Forest performed best for prediction.

  • Fourth item This kind of analysis can help trading firms optimize their strategies based on sentiment indicators.

TECH STACK

Python, Pandas, NumPy, Matplotlib, Seaborn, Scikit-learn

How to Run

# Clone the repo
git clone https://github.com/gaurav9364/Trader-Behavior-Insights-ML.git
cd Trader-Behavior-Insights-ML

# Install dependencies
pip install -r requirements.txt

# Run the notebook
jupyter notebook notebooks/trader_behavior_insights.ipynb

👤 Author

Gaurav Yadav

[email protected]

LinkedIn

GitHub

About

An end-to-end machine learning project analyzing the relationship between Bitcoin market sentiment (Fear & Greed Index) and trader performance. Built predictive models to uncover behavioral trading patterns and optimize decision-making in Web3 trading.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published