マクロデータと予測市場が一致する場合
予測市場が好奇心からインフラへと移行しました カルシ 取引先は"Will"のような結果で取引することができます. アメリカCPI exceed 3.5% in April?" or "Will the 連邦準備制度理事会 グローバルオープンアクセスでマクロイベントの類似のバイナリー結果市場を提供しています. 両プラットフォームはリアルタイムで確率価格を設定し,どちらも移動するマクロデータリリースに敏感です. ドル/JPYほら EUR/USD金融システムの一部です
FXMacroData を使って,中央銀行のカレンダーを追跡し,CPIのサプライズを監視し,政策利率の歴史を抽出している方は,これらの市場で体系的な優位性を築くための原材料を持っています.このガイドでは,ドットを接続する方法を示します.FXMacro Data から構造化されたマクロデータを抽出し,予測市場契約を開くマップにマッピングし,Python で再現可能な意思決定ワークフローを構築します.
このガイドの終わりまでに,FXMacroDataから来るマクロ発表を入手し,それらをカルシとポリマーケットの関連予測市場契約にマッチし,あなたの位置を伝えるのに役立つために,歴史的なサプライズデータから方向信号を計算する Python スクリプトを手に入れます.
条件
- FXMacroData API キーを 登録してください 無料で試用版を
- Python 3.10 以降で
requests設置されている (pip install requests) について - API アクセスが有効な Kalshi アカウントか 手動のクロス参照のための Polymarket ウォレット
- 基本知識はCPIで 農地以外の給与ほら 政策金利 決定は
ステップ1 発売予定のカレンダーを引っ張る
必要なのは,どの発表がいつ来るのか,はっきりと把握することです. FXMacroData のリリースカレンダーエンドポイントは,通貨の予定されているマクロイベントを,予想日時と発表時間とともに返します.
import requests
API_KEY = "YOUR_API_KEY"
BASE = "https://fxmacrodata.com/api/v1"
def get_upcoming_releases(currency: str) -> list[dict]:
url = f"{BASE}/calendar/{currency}?api_key={API_KEY}"
resp = requests.get(url, timeout=10)
resp.raise_for_status()
return resp.json().get("data", [])
usd_calendar = get_upcoming_releases("usd")
for event in usd_calendar[:5]:
print(event["indicator"], event.get("announcement_datetime"), event.get("next_release_date"))
記入するものは全て indicator (例えば inflationほら non_farm_payrollsほら policy_rate), the scheduled announcement time as a Unix timestamp, and the next expected release date. This is your primary input for filtering open prediction market contracts — if a contract resolves on "CPI for March 2026" you need the exact announcement date to size your time horizon correctly.
ステップ2 履歴発表データを取得し,サプライズシリーズを計算する
Prediction markets price probability based on available information. If you can compute a recent-history surprise index for a given indicator — how often actual prints beat consensus, and by how much — you have a baseline for calibrating your position. Pull the last twelve months of actual vs. forecast data from the announcements endpoint:
def get_announcement_history(currency: str, indicator: str, limit: int = 24) -> list[dict]:
url = f"{BASE}/announcements/{currency}/{indicator}?api_key={API_KEY}&limit={limit}"
resp = requests.get(url, timeout=10)
resp.raise_for_status()
return resp.json().get("data", [])
def compute_surprise_series(records: list[dict]) -> list[dict]:
surprises = []
for r in records:
actual = r.get("actual_value")
consensus = r.get("predicted_value")
if actual is not None and consensus is not None:
surprises.append({
"date": r["date"],
"actual": actual,
"consensus": consensus,
"surprise": actual - consensus,
"direction": "beat" if actual > consensus else "miss",
})
return surprises
cpi_history = get_announcement_history("usd", "inflation", limit=24)
cpi_surprises = compute_surprise_series(cpi_history)
beat_count = sum(1 for s in cpi_surprises if s["direction"] == "beat")
miss_count = len(cpi_surprises) - beat_count
print(f"CPI beat rate (last 24 releases): {beat_count}/{len(cpi_surprises)} = {beat_count/len(cpi_surprises):.0%}")
ほら predicted_value 広告記録の各フィールドは,権威のあるソース (フィラデルフィア連邦準備制度のプロ予測者調査のUSD指標) から市場コンセンサスを保存します. これは予測市場価格をアンカーする同じコンセンサス信号です. したがって,サプライズシリーズは,カルシCPI契約に埋め込まれた暗黙の確率と直接比較されます.
ステップ3 予測市場契約の地図指標
カルシとポリマークレットの両社は,特定の指標の値に基づいてマクロコントラクトを構成しています.FXMacroData指標スラグを知った後,マッピングは簡単です.下記は最も流動性のあるコントラクートの参照表です:
| 予測市場契約の種類 | FXMacroData インディケーター スラグ | 通貨 | API ドキュメント |
|---|---|---|---|
| CPIはX%を超えるのか? | inflation |
ドル | /api-data-docs/USD/インフレ 通貨膨張について |
| 核心CPIはX%を超えるのか? | core_inflation |
ドル | /api-data-docs/usd/core_inflation インフレ率について |
| NFPはX000を超えるか? | non_farm_payrolls |
ドル | /api-data-docs/usd/非農業_給与表 |
| 連邦準備制度理事会はFOMCを削減/維持/引き上げする? | policy_rate |
ドル | /api-data-docs/usd/policy_rate 税率について |
| GDPの成長率はX%を超えるのか? | gdp_quarterly |
ドル | /api-data-docs/usd/GDP_quarterly 年間総生産 |
| 失業率はX%以下になるのか? | unemployment |
ドル | /api-data-docs/usd/失業 失業率について |
| ECBは次の会合で金利を下げるのか? | policy_rate |
ユーロ | /api-data-docs/eur/policy_rate 政策のレート |
ほら リリースカレンダー 解決日程をリストしている場合, 解決日のリストを next_release_date 契約が先行見積もりと最終修正に決まる場合の不一致は,価格の誤りの一般的な原因である.
ステップ4 合意の固定のための予測エンドポイントをクエリする
FXMacroDataの予測エンドポイントは,公式調査データから得られた前向きなコンセンサス値を提供します. 予測市場参加者が先行をアンカーするために使用する同じアンケートです. 次のCPIリリースのための現在のコンセンサスを抽出し,開かれたカルシ契約の値と比較します:
def get_predictions(currency: str, indicator: str) -> list[dict]:
url = f"{BASE}/predictions/{currency}/{indicator}?api_key={API_KEY}"
resp = requests.get(url, timeout=10)
resp.raise_for_status()
return resp.json().get("data", [])
cpi_predictions = get_predictions("usd", "inflation")
# Most recent upcoming prediction
if cpi_predictions:
next_pred = cpi_predictions[0]
for p in next_pred.get("predictions", []):
print(f"Source: {p['prediction_source_label']}")
print(f"Consensus: {p['predicted_value']}%")
print(f"For release date: {next_pred['date']}")
検体応答形状:
{
"currency": "USD",
"indicator": "inflation",
"count": 1,
"prediction_count": 1,
"data": [
{
"announcement_id": "usd_inflation_2026-05-14",
"currency": "usd",
"indicator": "inflation",
"date": "2026-05-14",
"announcement_datetime": 1747216200,
"predictions": [
{
"predicted_value": 2.8,
"prediction_type": "market_consensus",
"prediction_source": "philly_fed_spf",
"prediction_source_label": "Philadelphia Fed Survey of Professional Forecasters"
}
]
}
]
}
If a Kalshi contract asks "Will April CPI print above 2.9%?" and the SPF consensus is 2.8%, you now have a quantified starting point: the consensus says no with a 0.1 percentage point buffer. Your historical surprise series from Step 2 then tells you how often CPI has beaten consensus by more than 0.1 percentage point, giving you an empirical base rate to compare against the contract's implied probability.
ステップ5 決定の完全な信号を構築する
Assemble the three inputs into a single decision function. The logic is intentionally simple — the goal is a reproducible, data-grounded signal, not a black box:
def prediction_market_signal(
currency: str,
indicator: str,
contract_threshold: float,
contract_direction: str, # "above" or "below"
lookback: int = 24,
) -> dict:
"""
Returns a signal dict for a prediction market contract.
contract_threshold: the numeric threshold in the contract question
(e.g. 2.9 for "Will CPI exceed 2.9%?")
contract_direction: "above" means YES if actual > threshold
"""
history = get_announcement_history(currency, indicator, limit=lookback)
surprises = compute_surprise_series(history)
predictions = get_predictions(currency, indicator)
consensus = None
release_date = None
if predictions:
latest_preds = predictions[0].get("predictions", [])
if latest_preds:
consensus = latest_preds[0]["predicted_value"]
release_date = predictions[0]["date"]
# Base rate: how often did actual exceed the threshold historically?
actuals_above = sum(1 for r in history if r.get("actual_value") is not None
and r["actual_value"] > contract_threshold)
base_rate = actuals_above / len(history) if history else None
# Surprise bias: mean surprise (positive = beat)
mean_surprise = (sum(s["surprise"] for s in surprises) / len(surprises)
if surprises else None)
# Directional signal
if consensus is not None:
buffer = consensus - contract_threshold # positive = consensus above threshold
signal = "NO" if (contract_direction == "above" and buffer > 0) else "YES"
else:
signal = "NEUTRAL"
return {
"currency": currency.upper(),
"indicator": indicator,
"contract_threshold": contract_threshold,
"contract_direction": contract_direction,
"consensus": consensus,
"release_date": release_date,
"historical_base_rate_above_threshold": base_rate,
"mean_surprise_last_n": mean_surprise,
"lookback": lookback,
"signal": signal,
}
result = prediction_market_signal(
currency="usd",
indicator="inflation",
contract_threshold=2.9,
contract_direction="above",
lookback=24,
)
import json
print(json.dumps(result, indent=2))
輸出例:
{
"currency": "USD",
"indicator": "inflation",
"contract_threshold": 2.9,
"contract_direction": "above",
"consensus": 2.8,
"release_date": "2026-05-14",
"historical_base_rate_above_threshold": 0.33,
"mean_surprise_last_n": 0.04,
"lookback": 24,
"signal": "NO"
}
これは以下のように読みましょう:コンセンサスは2.8% (2.9%の値以下),CPI印刷の2.9%以上の24回のリリースの歴史的ベースレートは33%,平均サプライズは控えめな0.04ppt上昇バイアスでした.原始信号はNOですが,ベースレートとサプライズバイアスの組み合わせは,これは高い確信の軽量ではなく,それに応じてポジションサイズを調整することを教えてくれます.
Step 6 — Extend to non-USD and cross-market contracts
予測市場は,日益,ユーロ以外のマクロイベントに関する契約をリストしている.ECBの決定,英国のCPI,日本銀行の政策,オーストラリアの雇用.FXMacroDataは,これらのすべてのものを同じエンドポイント構造を通じてカバーし,通貨コードと指標スラグを交換し,ワークフローは同一である.
# ECB rate decision signal
ecb_signal = prediction_market_signal(
currency="eur",
indicator="policy_rate",
contract_threshold=3.15, # "Will ECB rate fall below 3.15%?"
contract_direction="below",
lookback=12,
)
# UK inflation signal
uk_cpi_signal = prediction_market_signal(
currency="gbp",
indicator="inflation",
contract_threshold=2.5,
contract_direction="above",
lookback=18,
)
# Australian employment signal
aus_employment_signal = prediction_market_signal(
currency="aud",
indicator="employment",
contract_threshold=30.0, # thousands, "Will employment add 30K+?"
contract_direction="above",
lookback=18,
)
ほら EUR/USD ほら 通貨の対価 ポジションをコミットする前に視覚的なコンテキストチェックをします. ダイッシュボードが表示される場合, 銀行 has been cutting consistently over the last four meetings, a contract asking "Will the ECB cut in June?" has very different base-rate dynamics than one asking "Will the ECB hike?"
ステップ7 確認層としてCOT位置を監視する
外国為替先物における投機的なポジショニングは,しばしば同じ方向的な見解を反映します. COTダッシュボード CPIのプレントに進む大きな投機者が,純長ドルか短ドルかを示します.スペックが大きく純長USDで,CPI信号がNO (しきい値以下) であれば,潜在的なダブルエッジがあります.予測市場契約は消える価値があり,FXポジションも圧縮に脆弱かもしれません.
プログラムで COTデータを抽出して信号フレームワークに組み込む:
def get_cot(currency: str) -> list[dict]:
url = f"{BASE}/cot/{currency}?api_key={API_KEY}&limit=4"
resp = requests.get(url, timeout=10)
resp.raise_for_status()
return resp.json().get("data", [])
usd_cot = get_cot("usd")
if usd_cot:
latest = usd_cot[0]
net_position = latest.get("net_position")
print(f"USD spec net position (latest week): {net_position:+,.0f} contracts")
組み立てた
作業の流れは次のようになります.
- 引き出して リリースカレンダー 発表の予定時間と 発表を特定する
- 試合発表日 公開予測市場契約 カーシやポリマーケットで
- 持ってきて 予測 終点 現在のコンセンサス値です
- 計算する 歴史的なサプライズシリーズ 方向性偏差とベースレートを測定する
- 生成する 方向信号 合意と契約の限界を比較することで
- 選択的に層を入力します COT位置付け 確認信号として
- 契約の暗示された確率と 基礎利率の推定のギャップを ベースに ポジションを評価します
FXMacroData provides second-level
announcement_datetime timestamps for every release — critically important for prediction markets that resolve within seconds of the official print. Always verify that the contract's stated resolution source (e.g. "BLS CPI for March 2026, first release") matches exactly the FXMacroData indicator and revision flag you are querying. Advance estimates and final revisions are stored as separate data points.
始めよう
本ガイドで使用されているすべてのエンドポイントは無料試用で利用できます.クレジットカードは必要ありません.CPI,NFP,GDP,失業率,コアPCE,および政策利率を含むUSD指標は無料レベルで利用可能です.非USD指標およびCOTデータはプロフェッショナルプランが必要です.
- 登録してAPIキーを取得しますありがとうございました / サブスクリプト
- リリースカレンダーありがとうございました /ダッシュボード/リリースカレンダー
- ドル指標カタログありがとうございました /api-data-docs/usd ファイルファイル
- COTダッシュボードありがとうございました /ダッシュボード/ベッド