# Fear & Greed Index Backtester (`gochujang/fear-greed-backtester`) Actor

Backtest the crypto Fear & Greed Index as a trading signal. Computes BTC forward returns (1d/7d/30d) for each sentiment zone (extreme fear to extreme greed) over 365 days. Current signal + contrarian action. No API key. $0.02/run.

- **URL**: https://apify.com/gochujang/fear-greed-backtester.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00 / 1,000 backtest runs

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does Fear & Greed Index Backtester do?

**Fear & Greed Index Backtester** downloads up to 365 days of historical **Crypto Fear & Greed Index** readings from alternative.me and correlates them with **Bitcoin price movements** from CoinGecko. It computes forward returns (1-day, 7-day, 30-day) for each sentiment zone — extreme fear through extreme greed — to validate or refute the "buy the fear" contrarian trading strategy.

The actor delivers a current trading signal based on today's Fear & Greed reading, statistical win rates by zone, and a complete daily data export ready for spreadsheet analysis or backtesting integration.

### Why use Fear & Greed Index Backtester?

- **Quantified contrarian strategy**: Know exactly how often buying extreme fear (0–24) has led to positive BTC returns over 1, 7, and 30 days — not just anecdotally, but from the full data set
- **Win rates and averages by zone**: Compare extreme fear vs greed zones across all three forward windows to see which signal is statistically strongest
- **Today's signal with context**: The current contrarian recommendation (strong_buy / reduce / etc.) is backed by historical base rates, not just intuition
- **Full daily export**: Every FNG reading paired with actual BTC price and realized forward returns — ready for your own analysis
- **No API key needed**: Runs immediately with no configuration required; alternative.me and CoinGecko APIs are both public

### How to use Fear & Greed Index Backtester

1. Go to the Apify Store and find **Fear & Greed Index Backtester**
2. Click **Try for free** — no API keys or accounts needed
3. Optionally set `lookbackDays` to limit the backtest window (default: 365)
4. Click **Run** — results appear in seconds
5. Review the first record (summary + backtest stats) and individual daily rows via JSON export or API

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `lookbackDays` | integer | 365 | Historical days to include (30–365 max) |

### Output

```json
[
  {
    "current_date": "2026-09-02",
    "current_value": 31,
    "current_label": "fear",
    "current_signal": {
      "action": "buy",
      "rationale": "Fear zone. Historically positive 30d forward returns. Accumulate."
    },
    "backtest_days": 365,
    "earliest_date": "2025-09-02",
    "zone_distribution": {
      "extreme_fear": 28,
      "fear": 87,
      "neutral": 45,
      "greed": 143,
      "extreme_greed": 62
    },
    "extreme_fear_30d_avg_return_pct": 18.4,
    "extreme_fear_30d_win_rate_pct": 74.1,
    "extreme_greed_30d_avg_return_pct": -3.7,
    "extreme_greed_30d_win_rate_pct": 39.2,
    "forward_returns_30d": {
      "extreme_fear": {"sample_count": 28, "avg_return_pct": 18.4, "win_rate_pct": 74.1},
      "fear": {"sample_count": 87, "avg_return_pct": 9.1, "win_rate_pct": 63.2},
      "neutral": {"sample_count": 45, "avg_return_pct": 4.2, "win_rate_pct": 57.8},
      "greed": {"sample_count": 143, "avg_return_pct": 2.1, "win_rate_pct": 51.0},
      "extreme_greed": {"sample_count": 62, "avg_return_pct": -3.7, "win_rate_pct": 39.2}
    },
    "as_of": "2026-09-02T12:00:00Z"
  },
  {
    "date": "2026-09-02",
    "fng_value": 31,
    "fng_label": "fear",
    "fng_zone": "fear",
    "btc_price": 62450.81,
    "return_1d": 1.42,
    "return_7d": 5.18,
    "return_30d": null
  }
]
```

### Data fields

**Summary record (first row):**

| Field | Description |
|-------|-------------|
| `current_value` | Today's Fear & Greed Index value (0–100) |
| `current_label` | Zone label (extreme_fear, fear, neutral, greed, extreme_greed) |
| `current_signal` | Contrarian action and rationale |
| `zone_distribution` | Count of days spent in each zone over the backtest period |
| `forward_returns_1d/7d/30d` | Full zone-by-zone stats for each forward window |
| `extreme_fear_30d_avg_return_pct` | Average 30-day BTC return when FNG was in extreme fear |
| `extreme_fear_30d_win_rate_pct` | % of extreme fear days where 30d BTC return was positive |
| `extreme_greed_30d_avg_return_pct` | Average 30-day BTC return when FNG was in extreme greed |
| `extreme_greed_30d_win_rate_pct` | % of extreme greed days with positive 30d return |

**Daily data rows:**

| Field | Description |
|-------|-------------|
| `date` | Date (YYYY-MM-DD) |
| `fng_value` | Fear & Greed reading for that day (0–100) |
| `fng_zone` | Zone classification |
| `btc_price` | BTC closing price in USD |
| `return_1d/7d/30d` | Actual BTC % return over that forward window from this date |

### Cost estimation

Pricing: **$0.02 per run** (flat rate — always one complete backtest)

| Scenario | Frequency | Monthly cost |
|----------|-----------|--------------|
| One-time check | Once | $0.02 |
| Weekly strategy review | 4×/month | $0.08 |
| Daily signal monitoring | 30×/month | $0.60 |

### FAQ

**Is this proof that the contrarian strategy works?**
No — this actor shows historical correlations, not guaranteed future returns. BTC price behavior changes with market conditions. Use the data as one input among many, not as a trading strategy in isolation.

**Why might extreme fear show high win rates but still lose money?**
Even with a 74% win rate, the losing 26% of cases can include severe drawdowns. The average return and win rate together tell a more complete story than either metric alone.

**Can I export the daily data to Excel or Google Sheets?**
Yes — after the actor run, use the Apify dataset export (CSV/JSON) directly from the console, or connect via the Apify API with an integration such as Google Sheets Apify integration.

*Disclaimer: This actor provides historical statistical analysis for educational and research purposes only. Past performance of a trading signal is not indicative of future results. Nothing in this output constitutes financial or investment advice.*

Keywords: crypto fear and greed index backtest, buy the fear strategy, BTC sentiment indicator, alternative.me fear greed history, crypto contrarian trading, fear greed index correlation, Bitcoin sentiment backtest, extreme fear buy signal, greed sell signal crypto, FNG historical data

***

### Related actors

- [Crypto Social Sentiment Aggregator](https://apify.com/gochujang/social-sentiment-aggregator) — Live Fear & Greed index alongside Reddit and LunarCrush sentiment for real-time complement
- [Crypto Market Breadth](https://apify.com/gochujang/crypto-market-breadth) — Advance/decline breadth signal to validate Fear & Greed contrarian timing with market internals
- [Bitcoin On-Chain Metrics](https://apify.com/gochujang/bitcoin-onchain-metrics) — MVRV, NUPL, and exchange netflow to pair with sentiment backtesting for full signal stack

### Feedback

If this actor helps your strategy research, a review helps others find it: [Leave a review on Apify Store](https://apify.com/gochujang/fear-greed-backtester#reviews)

***

**Keywords:** fear greed backtester, crypto sentiment backtest, Fear Greed Index trading, BTC forward returns, crypto sentiment signal, contrarian trading, sentiment zones, extreme fear trading, crypto backtest, sentiment analysis crypto, trading signal backtest, BTC sentiment, market sentiment

# Actor input Schema

## `lookbackDays` (type: `integer`):

Number of historical days to include in the backtest (max 365).

## Actor input object example

```json
{
  "lookbackDays": 365
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/fear-greed-backtester").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("gochujang/fear-greed-backtester").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call gochujang/fear-greed-backtester --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gochujang/fear-greed-backtester"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/W2c6LO6tdoYY5ZgoT/builds/ZxZHb6xbbbtthiTHh/openapi.json
