Economic Indicator Tracker
INDICATORS = {
"leading": [
{"name": "PMI Manufacturing", "frequency": "monthly", "impact": "HIGH", "pairs": ["USD", "EUR", "GBP"]},
{"name": "Building Permits", "frequency": "monthly", "impact": "MEDIUM", "pairs": ["USD"]},
{"name": "Consumer Confidence", "frequency": "monthly", "impact": "MEDIUM", "pairs": ["USD", "EUR"]},
{"name": "Yield Curve 2-10", "frequency": "daily", "impact": "HIGH", "pairs": ["USD"]},
{"name": "New Orders Index", "frequency": "monthly", "impact": "MEDIUM", "pairs": ["USD"]},
{"name": "Stock Market (SPX)", "frequency": "daily", "impact": "HIGH", "pairs": ["ALL"]},
{"name": "Initial Jobless Claims", "frequency": "weekly", "impact": "MEDIUM", "pairs": ["USD"]}],
"coincident": [
{"name": "Non-Farm Payrolls", "frequency": "monthly", "impact": "HIGH", "pairs": ["USD"]},
{"name": "Industrial Production", "frequency": "monthly", "impact": "MEDIUM", "pairs": ["USD", "EUR"]},
{"name": "Retail Sales", "frequency": "monthly", "impact": "HIGH", "pairs": ["USD", "GBP"]},
{"name": "GDP", "frequency": "quarterly", "impact": "HIGH", "pairs": ["ALL"]}],
"lagging": [
{"name": "CPI / Inflation", "frequency": "monthly", "impact": "HIGH", "pairs": ["ALL"]},
{"name": "Unemployment Rate", "frequency": "monthly", "impact": "HIGH", "pairs": ["USD"]},
{"name": "Core PCE", "frequency": "monthly", "impact": "HIGH", "pairs": ["USD"]},
{"name": "Average Hourly Earnings", "frequency": "monthly", "impact": "MEDIUM", "pairs": ["USD"]}],
}
class EconomicIndicatorTracker:
@staticmethod
def cycle_position(leading_trend: str, coincident_trend: str, lagging_trend: str) -> dict:
if leading_trend == "improving" and coincident_trend == "improving":
phase = "EXPANSION — risk-on currencies favored (AUD, NZD, CAD)"
elif leading_trend == "deteriorating" and coincident_trend == "improving":
phase = "LATE CYCLE — be cautious, peak may be near"
elif leading_trend == "deteriorating" and coincident_trend == "deteriorating":
phase = "CONTRACTION — safe havens favored (JPY, CHF, USD, Gold)"
elif leading_trend == "improving" and coincident_trend == "deteriorating":
phase = "EARLY RECOVERY — selective risk-on, high-beta currencies"
else:
phase = "TRANSITION — mixed signals"
return {"phase": phase, "leading": leading_trend, "coincident": coincident_trend, "lagging": lagging_trend}
@staticmethod
def surprise_index(actual: float, forecast: float, previous: float) -> dict:
surprise = actual - forecast
beat = actual > forecast
return {
"surprise": round(surprise, 3),
"beat_expectations": beat,
"vs_previous": "improving" if actual > previous else "deteriorating",
"market_impact": "Positive surprise — currency should strengthen" if beat else "Negative surprise — currency weakens",
}
1---2name: economic-indicator-tracker3description: Track leading, lagging, and coincident economic indicators systematically. Use for "economic indicators", "leading indicator", "lagging indicator", "PMI tracker", "GDP tracker", "jobs data", "inflation tracker", "economic cycle", "recession indicator", "expansion indicator", "economic health", or any systematic macro indicator tracking. Works with macro-economic-dashboard.4---56# Economic Indicator Tracker78```python9INDICATORS = {10 "leading": [11 {"name": "PMI Manufacturing", "frequency": "monthly", "impact": "HIGH", "pairs": ["USD", "EUR", "GBP"]},12 {"name": "Building Permits", "frequency": "monthly", "impact": "MEDIUM", "pairs": ["USD"]},13 {"name": "Consumer Confidence", "frequency": "monthly", "impact": "MEDIUM", "pairs": ["USD", "EUR"]},14 {"name": "Yield Curve 2-10", "frequency": "daily", "impact": "HIGH", "pairs": ["USD"]},15 {"name": "New Orders Index", "frequency": "monthly", "impact": "MEDIUM", "pairs": ["USD"]},16 {"name": "Stock Market (SPX)", "frequency": "daily", "impact": "HIGH", "pairs": ["ALL"]},17 {"name": "Initial Jobless Claims", "frequency": "weekly", "impact": "MEDIUM", "pairs": ["USD"]}],18 "coincident": [19 {"name": "Non-Farm Payrolls", "frequency": "monthly", "impact": "HIGH", "pairs": ["USD"]},20 {"name": "Industrial Production", "frequency": "monthly", "impact": "MEDIUM", "pairs": ["USD", "EUR"]},21 {"name": "Retail Sales", "frequency": "monthly", "impact": "HIGH", "pairs": ["USD", "GBP"]},22 {"name": "GDP", "frequency": "quarterly", "impact": "HIGH", "pairs": ["ALL"]}],23 "lagging": [24 {"name": "CPI / Inflation", "frequency": "monthly", "impact": "HIGH", "pairs": ["ALL"]},25 {"name": "Unemployment Rate", "frequency": "monthly", "impact": "HIGH", "pairs": ["USD"]},26 {"name": "Core PCE", "frequency": "monthly", "impact": "HIGH", "pairs": ["USD"]},27 {"name": "Average Hourly Earnings", "frequency": "monthly", "impact": "MEDIUM", "pairs": ["USD"]}],28}2930class EconomicIndicatorTracker:31 @staticmethod32 def cycle_position(leading_trend: str, coincident_trend: str, lagging_trend: str) -> dict:33 if leading_trend == "improving" and coincident_trend == "improving":34 phase = "EXPANSION — risk-on currencies favored (AUD, NZD, CAD)"35 elif leading_trend == "deteriorating" and coincident_trend == "improving":36 phase = "LATE CYCLE — be cautious, peak may be near"37 elif leading_trend == "deteriorating" and coincident_trend == "deteriorating":38 phase = "CONTRACTION — safe havens favored (JPY, CHF, USD, Gold)"39 elif leading_trend == "improving" and coincident_trend == "deteriorating":40 phase = "EARLY RECOVERY — selective risk-on, high-beta currencies"41 else:42 phase = "TRANSITION — mixed signals"43 return {"phase": phase, "leading": leading_trend, "coincident": coincident_trend, "lagging": lagging_trend}4445 @staticmethod46 def surprise_index(actual: float, forecast: float, previous: float) -> dict:47 surprise = actual - forecast48 beat = actual > forecast49 return {50 "surprise": round(surprise, 3),51 "beat_expectations": beat,52 "vs_previous": "improving" if actual > previous else "deteriorating",53 "market_impact": "Positive surprise — currency should strengthen" if beat else "Negative surprise — currency weakens",54 }55```