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)