# Macro Event Edge: Calendar, Trader Sentiment, Market Odds (`scrapemint/macro-event-edge-pipeline`) Actor

For each upcoming high-impact economic event, see how traders are positioned and what prediction markets imply. Chains an economic calendar with TradingView trader sentiment for the affected symbols and Polymarket odds for the macro topic, scores an edge 0 to 100, and tiers events. No API keys.

- **URL**: https://apify.com/scrapemint/macro-event-edge-pipeline.md
- **Developed by:** [Ken M](https://apify.com/scrapemint) (community)
- **Categories:** Business, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Macro Event Edge: Calendar, Trader Sentiment, Market Odds

For every upcoming high-impact economic event, see **how traders are positioned** on the assets it moves and **what prediction markets imply** about the macro outcome, all in one scored row. Stop juggling an economic calendar, a TradingView tab, and a Polymarket tab.

The pipeline reads three independent public sources, joins them around each scheduled event, and ranks the setups. No API keys, no developer accounts.

### What it does

1. **Economic calendar.** Pulls the upcoming events for your window from ForexFactory: currency, event, time, impact, forecast vs previous.
2. **Trader sentiment.** For each event currency, pulls TradingView ideas on the symbols it moves (USD touches DXY, SPX, EURUSD, gold and more), then reads the bull vs bear lean and how loud the discussion is.
3. **Prediction markets.** Pulls Polymarket odds for the macro topics on the calendar (Fed rate, inflation, jobs, growth) and reads the implied probability and how it moved this week.
4. **Join and score.** Attaches the trader and market reads to each event by symbol and topic, then scores an edge 0 to 100.

### Scoring

The edge score (0 to 100) is the sum of:

- **Impact (up to 35).** High-impact events score far above medium.
- **Proximity (up to 20).** An event in the next 24 hours scores above one a week out.
- **Trader signal (up to 25).** How many TradingView ideas exist on the affected symbols and how lopsided the bull vs bear lean is.
- **Market signal (up to 20).** Prediction-market volume on the related topic and how far the implied probability moved this week.

Tiers:

- **high_conviction** — a high-impact event scoring 60+ with a strong trader lean or a strong prediction-market move. The clearest setups.
- **elevated** — any high-impact event, or any event scoring 42+.
- **watch** — cleared the gate with a lower edge.

### Output

One row per economic event:

```json
{
  "event": "Core CPI m/m",
  "currency": "USD",
  "impact": "high",
  "eventTime": "2026-06-11T12:30:00.000Z",
  "hoursUntil": 41,
  "forecast": "0.3%",
  "previous": "0.2%",
  "edgeScore": 78,
  "tier": "high_conviction",
  "macroTopics": ["inflation"],
  "traderSentiment": {
    "symbols": ["DXY", "SPX", "EURUSD", "XAUUSD"],
    "ideaCount": 22,
    "bullish": 14,
    "bearish": 5,
    "lean": 0.47,
    "leanLabel": "bullish",
    "topIdeas": [{ "title": "...", "symbol": "XAUUSD", "direction": "bullish", "url": "...", "likes": 167 }]
  },
  "predictionMarkets": {
    "count": 3,
    "maxOneWeekMove": 0.135,
    "topMarkets": [{ "question": "Will inflation be above 3% in 2026?", "yesPrice": 0.62, "volume24h": 144623, "oneWeekChange": 0.13, "url": "..." }]
  },
  "scoredAt": "2026-06-07T09:00:00.000Z"
}
````

### Input

- `range` — calendar window (this\_week, next\_week, today, tomorrow, this\_month). this\_month gives the fullest catalyst set.
- `impactLevels` — which impact levels to score (default high and medium).
- `currencies` — limit to specific currencies, e.g. USD and EUR.
- `includeTradingView` / `includePolymarket` — turn either enrichment off.
- `maxEventsTotal`, `maxIdeasPerSymbol`, `minScore` — caps and the noise gate.

### Pricing and combined cost

This actor charges per scored event: **watch $0.05**, **elevated $0.10**, **high\_conviction $0.15**. The first 3 high conviction events per run are free so you can validate output.

This is a pipeline: it runs three child actors, and **each child also bills you for its own per-item usage** (forexfactory-economic-calendar per event, tradingview-ideas-scraper per idea, polymarket-market-monitor per item). Your total for a run is the event charges above **plus** those child charges. Use `maxEventsTotal` and `maxIdeasPerSymbol` to control volume and cost.

### Notes on sources

- The economic calendar, TradingView ideas, and Polymarket markets are all public. Trader direction is read from each idea's stated direction and its title, so it is a best read, not a label from the author.
- A symbol is linked to an event by the event currency, and a prediction market is linked by shared macro topic, so the joins are by mapping rather than an exact shared key.
- Quiet weeks have few high-impact events. That is the market being quiet, not a gap in coverage.

# Actor input Schema

## `range` (type: `string`):

Which window of the economic calendar to pull. this\_month gives the fullest catalyst set.

## `impactLevels` (type: `array`):

Which event impact levels to score. high alone is the cleanest catalyst set.

## `currencies` (type: `array`):

Limit to events for these currencies, e.g. \["USD", "EUR"]. Empty pulls all.

## `maxEventsTotal` (type: `integer`):

Cap on events scored, soonest first.

## `includeTradingView` (type: `boolean`):

Attach TradingView ideas for the symbols tied to each event's currency.

## `includePolymarket` (type: `boolean`):

Attach Polymarket odds for the macro topics present in the calendar.

## `maxIdeasPerSymbol` (type: `integer`):

How many TradingView ideas to pull per affected symbol. Higher reads sentiment better but raises the child cost.

## `minScore` (type: `integer`):

Drop and never charge events scoring below this 0 to 100 threshold. 0 keeps every qualifying event.

## `proxyConfiguration` (type: `object`):

Proxy passed through to the child actors. Residential is recommended for the calendar and TradingView.

## Actor input object example

```json
{
  "range": "this_week",
  "impactLevels": [
    "high",
    "medium"
  ],
  "currencies": [],
  "maxEventsTotal": 60,
  "includeTradingView": true,
  "includePolymarket": true,
  "maxIdeasPerSymbol": 30,
  "minScore": 0,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapemint/macro-event-edge-pipeline").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 = { "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    } }

# Run the Actor and wait for it to finish
run = client.actor("scrapemint/macro-event-edge-pipeline").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call scrapemint/macro-event-edge-pipeline --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scrapemint/macro-event-edge-pipeline",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Macro Event Edge: Calendar, Trader Sentiment, Market Odds",
        "description": "For each upcoming high-impact economic event, see how traders are positioned and what prediction markets imply. Chains an economic calendar with TradingView trader sentiment for the affected symbols and Polymarket odds for the macro topic, scores an edge 0 to 100, and tiers events. No API keys.",
        "version": "0.1",
        "x-build-id": "qJJr43nzX7gtdbCP6"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapemint~macro-event-edge-pipeline/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapemint-macro-event-edge-pipeline",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scrapemint~macro-event-edge-pipeline/runs": {
            "post": {
                "operationId": "runs-sync-scrapemint-macro-event-edge-pipeline",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scrapemint~macro-event-edge-pipeline/run-sync": {
            "post": {
                "operationId": "run-sync-scrapemint-macro-event-edge-pipeline",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "range": {
                        "title": "Calendar range",
                        "enum": [
                            "this_week",
                            "next_week",
                            "today",
                            "tomorrow",
                            "this_month"
                        ],
                        "type": "string",
                        "description": "Which window of the economic calendar to pull. this_month gives the fullest catalyst set.",
                        "default": "this_week"
                    },
                    "impactLevels": {
                        "title": "Impact levels",
                        "type": "array",
                        "description": "Which event impact levels to score. high alone is the cleanest catalyst set.",
                        "default": [
                            "high",
                            "medium"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "currencies": {
                        "title": "Currencies (optional)",
                        "type": "array",
                        "description": "Limit to events for these currencies, e.g. [\"USD\", \"EUR\"]. Empty pulls all.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxEventsTotal": {
                        "title": "Max events to score",
                        "minimum": 1,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Cap on events scored, soonest first.",
                        "default": 60
                    },
                    "includeTradingView": {
                        "title": "Include trader sentiment",
                        "type": "boolean",
                        "description": "Attach TradingView ideas for the symbols tied to each event's currency.",
                        "default": true
                    },
                    "includePolymarket": {
                        "title": "Include prediction markets",
                        "type": "boolean",
                        "description": "Attach Polymarket odds for the macro topics present in the calendar.",
                        "default": true
                    },
                    "maxIdeasPerSymbol": {
                        "title": "Max trader ideas per symbol",
                        "minimum": 10,
                        "maximum": 60,
                        "type": "integer",
                        "description": "How many TradingView ideas to pull per affected symbol. Higher reads sentiment better but raises the child cost.",
                        "default": 30
                    },
                    "minScore": {
                        "title": "Minimum edge score",
                        "minimum": 0,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Drop and never charge events scoring below this 0 to 100 threshold. 0 keeps every qualifying event.",
                        "default": 0
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Proxy passed through to the child actors. Residential is recommended for the calendar and TradingView.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
