DEV Community

Shivang Mishra
Shivang Mishra

Posted on

🚀 How Market Sentiment Impacts Trader Performance: A Deep Dive Using Bitcoin Fear & Greed Index + Hyperliquid Trader Data

Financial markets aren’t just math — they’re emotion.
Fear. Greed. Panic. FOMO. Confidence. Hesitation.
Every candle tells a psychological story.

So I decided to answer one powerful question:
Does market sentiment actually influence trader performance?
To explore this, I combined two datasets:
Bitcoin Fear & Greed Index (daily sentiment)
Hyperliquid Historical Trader Data (real trades: PnL, position size, timestamps)
Once merged, the insights were surprisingly clear.

📁 Datasets Used

1. Bitcoin Fear & Greed Index

The famous index that quantifies market psychology on a scale of 0–100.

Score Range Market Mood
0–24 Extreme Fear
25–44 Fear
45–54 Neutral
55–74 Greed
75–100 Extreme Greed

Columns:

  • date
  • value
  • classification
  1. Hyperliquid Trader Executions

Contains:

  • Timestamp
  • Execution Price
  • Size USD
  • Side (Buy/Sell)
  • Closed PnL

This tells how the trader performed each day.

🧹Step 1 — Data Cleaning & Preparation
We converted UNIX timestamps → dates and merged the datasets.

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns

sns.set(style="whitegrid")

trades = pd.read_csv("historical_data.csv")
sentiment = pd.read_csv("fear_greed_index.csv")

trades['Timestamp'] = pd.to_datetime(trades['Timestamp'], unit='ms')
trades['date'] = trades['Timestamp'].dt.date

trades_clean = trades[['Timestamp','date','Execution Price','Size USD','Side','Closed PnL']]
trades_clean.rename(columns={'Closed PnL':'pnl'}, inplace=True)

sentiment['date'] = pd.to_datetime(sentiment['date']).dt.date
sentiment_clean = sentiment[['date','value','classification']]

merged = pd.merge(trades_clean, sentiment_clean, on='date', how='left')
Enter fullscreen mode Exit fullscreen mode

Now every trade has the market sentiment associated with it.

🔍 Step 2 — Exploratory Data Analysis

📊 Fear & Greed Index Over Time
Helps visualize the emotional highs and lows of the market.

📈 Trader PnL Over Time
Shows profitable and rough periods.

💡 Average PnL by Sentiment

avg_pnl = merged.groupby('classification')['pnl'].mean().sort_values()
Enter fullscreen mode Exit fullscreen mode

💥 Key Result:

Best performance: ✔ Greed
Worst performance: ❌ Extreme Fear

The trader clearly performs better when markets are trending and confident.

📏 Position Size by Sentiment

avg_size = merged.groupby('classification')['Size USD'].mean()
Enter fullscreen mode Exit fullscreen mode

Insight:
Traders take larger positions during Greed phases.

This highlights a psychological pattern:

  • Confidence → bigger trades
  • Uncertainty → smaller positions

🎯 Win Rate by Sentiment

merged['win'] = (merged['pnl'] > 0).astype(int)
win_rate = merged.groupby('classification')['win'].mean()

Pattern:
Win rate peaks during Greed, drops during Fear.

📉Correlation Between Sentiment & PnL

corr = merged[['value','pnl']].corr()
Enter fullscreen mode Exit fullscreen mode

🧠 Step 3 — Key Insights

✔ 1. Performance increases in Greedy markets
Trends become cleaner and easier to ride.

✔ 2. Losses spike during Extreme Fear
Market becomes chaotic.

✔ 3. Trader takes larger positions when confident
Risk-taking aligns with sentiment.

✔ 4. Win rate highest in Greed phases
Clear sign that trend-following works better here.

✔ 5. Sentiment can filter bad trades
Avoiding Extreme Fear days = fewer drawdowns.

🔥 Step 4 — A Simple Sentiment-Aware Trading Strategy

You can turn these insights into a practical system:
🟥 Avoid trades when Fear Index < 20 (Extreme Fear)
Market too volatile → losses increase.

🟩 Increase position size when Greed Index > 60
Strong trends → higher win rate.

🟨 Trade normally in Neutral zones
Mean reversion works better here.

This simple sentiment filter can significantly improve risk-adjusted returns.

🎯 Conclusion

This analysis proves:

Market sentiment directly impacts trader performance.
Greed = opportunity
Fear = danger

By incorporating the Fear & Greed Index into decision-making, traders can:

  • Avoid bad market conditions
  • Maximize trend opportunities
  • Understand their own psychological biases
  • Improve long-term consistency

This combination of data + psychology = a real trading edge.

Top comments (0)