Skip to content

Bhardwaj-Arin/Trader-Performance-vs-Market-Sentiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trader Performance vs Market Sentiment

Objective

Analyze how Bitcoin market sentiment, measured by the Fear/Greed Index, relates to Hyperliquid trader behavior and performance.

Project Structure

.
├── analyze_trader_sentiment.py
├── data/
│   ├── fear_greed_index.csv
│   └── historical_data.csv
├── charts/
│   ├── avg_daily_pnl_by_sentiment.svg
│   ├── trade_frequency_by_sentiment.svg
│   ├── segment_pnl_per_trade.svg
│   └── daily_total_pnl.svg
├── outputs/
│   ├── data_profile.csv
│   ├── sentiment_performance_summary.csv
│   ├── segment_summary.csv
│   ├── daily_account_metrics.csv
│   ├── daily_market_metrics.csv
│   ├── account_segments.csv
│   └── top_accounts_by_pnl.csv
└── REPORT.md

How to Run

  1. Install dependencies:
pip install pandas numpy
  1. Place the two source CSV files in data/:
data/fear_greed_index.csv
data/historical_data.csv
  1. Run the analysis:
python analyze_trader_sentiment.py

The script regenerates all tables in outputs/, charts in charts/, and the written summary in REPORT.md.

Methodology

  • Standardized raw column names and parsed trader timestamps from Timestamp IST.
  • Created a daily date key and joined trades to the Bitcoin Fear/Greed dataset by date.
  • Aggregated trade-level data to account-day level to reduce bias from very active accounts.
  • Created performance metrics:
    • daily PnL
    • win rate
    • PnL per trade
    • PnL per $1k traded volume
    • downside-PnL drawdown proxy
  • Created behavior metrics:
    • trades per account-day
    • average trade size
    • long/short share
    • average position exposure proxy
  • The source trader dataset does not contain an explicit leverage column, so abs(start_position) * execution_price is used as an exposure proxy.

Key Findings

  1. Average daily account PnL was highest on Fear days and weakest on Greed days.
  2. Fear-side days had materially higher trade frequency than Greed-side days.
  3. Greed-side days had a higher average win rate, but lower average PnL than Fear-side days.
  4. The raw sentiment score has weak direct correlation with daily PnL, so it is better used as a risk-regime feature than as a standalone signal.
  5. Segmenting traders improves the story: infrequent traders had better PnL per trade than frequent traders, and consistent winners had better PnL per trade than inconsistent traders.

Strategy Recommendations

  1. Use sentiment as a risk filter. In weaker-performing regimes, especially Greed in this sample, reduce exposure and require stronger confirmation before increasing trade frequency.
  2. Apply segment-specific allocation. Prioritize trader archetypes with better PnL per trade, especially infrequent traders and consistent winners, while monitoring whether the advantage persists across sentiment regimes.

Main Outputs

  • REPORT.md: concise written summary for submission.
  • outputs/sentiment_performance_summary.csv: performance and behavior by sentiment classification.
  • outputs/segment_summary.csv: account segment comparison.
  • charts/avg_daily_pnl_by_sentiment.svg: core performance chart.
  • charts/trade_frequency_by_sentiment.svg: behavior shift chart.
  • charts/segment_pnl_per_trade.svg: segment comparison chart.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages