Global Macro logo

Global Macro

OrganizationPopular
HKUDS
global-macro

Global macro analysis framework (central bank policy transmission / FX forecasting / geopolitical risk / capital flows), used to build macro factor signals that drive cross-asset allocation.

Overview

PublisherHKUDS
RepositoryVibe-Trading
Skill nameglobal-macro
Stars
33.6K
Forks
5.5K
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by HKUDS on GitHub. Read the source before you install it.

Installation

Install the Global Macro AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git /tmp/Vibe-Trading
mkdir -p .claude/skills
cp -r /tmp/Vibe-Trading/agent/src/skills/global-macro .claude/skills/global-macro
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Global Macro in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Global Macro on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Global Macro is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Global Macro Analysis

Overview

Builds a macro analysis framework from three dimensions: central-bank policy, exchange-rate regimes, and geopolitics. Outputs quantifiable macro factor signals to drive cross-asset allocation decisions. Core logic: macro cycles determine major asset direction, while micro-level timing is delegated to other skills.

Core Concepts

1. Central Bank Policy Transmission Chain

Policy-rate changes → government bond yield curve → credit spreads → financing costs for the real economy → corporate earnings → equity valuation

Monitoring framework for the three major central banks:

Central BankCore IndicatorsForward SignalsLagging Confirmation
Federal Reserve (Fed)FFR, dot plot, SEPCME FedWatch probabilitiesnonfarm payrolls / CPI / PCE
European Central Bank (ECB)Main refinancing rateEurozone PMI, HICPcredit growth
Bank of Japan (BOJ)YCC band, policy rateJPY exchange rate, JGB yieldscore CPI

Historical transmission of Fed hiking / cutting cycles to China A-shares (empirical):

  • Late in a Fed hiking cycle (the last 1-2 hikes), China A-shares often have already priced it in, and the average drawdown of the CSI 300 narrows to -3%
  • In the 3 months after the first Fed cut, the CSI 300 has averaged +8.2% (mean of the 2001 / 2007 / 2019 cycles)
  • But rate cuts do not automatically mean gains. In 2008, cuts came with recession and China A-shares still fell

2. Exchange Rate Forecasting Framework

Three-layer model:

ModelApplicable HorizonCore VariablesAccuracy
Purchasing Power Parity (PPP)3-5 yearsCPI gap between two countriesLong-term anchor
Interest Parity (UIP/CIP)3-12 monthsrate differential + forward premium/discountMedium-term direction
BEER model1-3 yearsterms of trade + net foreign inflows + productivityEquilibrium estimate

USD/CNY practical checklist:

  • China-US 10Y spread > 0: appreciation pressure on the RMB (capital inflows)
  • China-US 10Y spread < -150bp: rising depreciation pressure on the RMB
  • Net FX settlement surplus / deficit: directly reflects conversion direction of corporates and households
  • PBOC fixing vs market expectation: signal that the countercyclical factor has been activated

3. Geopolitical Risk Assessment

Quantitative approach (proxy for the GPR index):

python
# Geopolitical risk proxy indicators
risk_indicators = {
    "vix": "Fear index > 25 = high risk",
    "gold_oil_ratio": "Gold / oil > 25 = rising risk aversion",
    "usd_index": "DXY jump > 2% / week = capital flowing back to USD",
    "credit_spread": "IG spread > 150bp = credit tightening",
    "em_spread": "EMBI spread widening > 50bp / month = emerging-market stress"
}

Typical asset impacts of geopolitical events (historical averages):

  • Local conflicts: gold +3-5%, oil +5-15%, equities -2-5%, with impact lasting 1-4 weeks
  • Trade friction: affected sectors -10-20%, beneficiary substitute sectors +5-10%, lasting 3-6 months
  • Financial sanctions: sanctioned-country currency -10-30%, commodity supply side hit

4. Global Capital Flow Tracking

Key data sources:

  • EPFR fund flows: weekly net inflows into global equity / bond funds
  • Northbound flows (Shanghai-Shenzhen-Hong Kong Stock Connect): daily, with net buying > 10 billion RMB in a day as a strong signal
  • US Treasury TIC data: monthly, showing changes in foreign holdings of Treasuries
  • FX reserve changes: quarterly, indicating central-bank asset allocation direction

Northbound flow signal rules (China A-share practice):

SignalConditionMeaning
Strong buyNet buying for 5 consecutive days and cumulative amount > 20 billion RMBForeign investors are building positions trendwise
Weak buySingle-day net buying > 8 billion RMBShort-term sentiment is bullish
WarningNet selling for 5 consecutive days and cumulative amount > 15 billion RMBForeign investors are reducing positions trendwise
NeutralDaily net flow within ±3 billion RMBNo directional signal

5. Dollar Cycle and Emerging Markets

Four-stage dollar cycle model:

Strong-dollar phase (DXY rising) → capital outflows from emerging markets → EM currency depreciation → EM equities and bonds both sell off
Weak-dollar phase (DXY falling) → capital flows back into EM → EM currency appreciation → EM assets outperform developed markets

Practical mapping:

  • DXY > 105 and trending up: underweight emerging markets (China A-shares / Hong Kong stocks), overweight USD assets
  • DXY < 100 and trending down: overweight emerging markets, underweight USD assets
  • DXY in the 100-105 range: allocate selectively based on fundamentals

Analysis Framework

Steps for Building a Macro Dashboard

  1. Data collection: rates (US 10Y / China 10Y government bonds), FX (DXY / USD-CNY), commodities (gold / oil / copper), capital flows (northbound / EPFR)
  2. Cycle positioning: which stage are we in now: hiking / cutting / pause? Strong-dollar or weak-dollar cycle?
  3. Factor scoring: score each macro factor from -2 to +2 (-2 = extremely bearish, +2 = extremely bullish)
  4. Asset mapping: macro factor scores → recommended weights for major asset classes

Example Macro Factor Scoring

python
macro_factors = {
    "fed_policy": +1,      # Hiking pause, dovish tilt
    "cny_pressure": -1,    # RMB depreciation pressure
    "geopolitical": 0,     # Neutral geopolitical risk
    "northbound_flow": +2, # Persistent net northbound buying
    "usd_cycle": -1,       # Stronger USD
}
# Composite score = sum(values) / len(values) = +0.2 → neutral to mildly bullish

Output Format

## Macro Analysis Report

### Cycle Positioning
- Federal Reserve: [late hiking / pause / early cutting]
- Dollar cycle: [strong / range-bound / weak]
- China monetary policy: [easing / neutral / tightening]

### Factor Scores (-2 ~ +2)
| Factor | Score | Basis |
|------|------|------|
| Central bank policy | +1 | Fed paused hiking and the market expects cuts this year |
| FX pressure | -1 | USD/CNY broke above 7.2 and FX settlement turned into deficit |
| Capital flows | +2 | Northbound net buying exceeded 20 billion RMB continuously |

### Asset Allocation Recommendations
- China A-shares: [overweight / neutral / underweight] — rationale
- Hong Kong stocks: [overweight / neutral / underweight] — rationale
- Gold: [overweight / neutral / underweight] — rationale
- US Treasuries: [overweight / neutral / underweight] — rationale

### Risk Warnings
- [specific risk events and potential impacts]

Notes

  • Macro analysis provides directional guidance, not precise timing. Leave timing to skills such as technical-basic or volatility
  • Central-bank policy judgment should be based on official statements and meeting minutes. Do not over-interpret unofficial messages
  • Exchange-rate forecasting has large errors. PPP deviations can persist for years, so use it for direction only, not exact levels
  • Northbound flows contain noise (arbitrage / hedging), so persistence matters (at least 3 consecutive days in the same direction)
  • Geopolitical shocks are usually short-lived (1-4 weeks) unless they change fundamentals (such as long-term sanctions or trade wars)
  • This framework is not investment advice and is for research backtesting only

Frequently asked questions

What does the Global Macro AI skill do?

Global macro analysis framework (central bank policy transmission / FX forecasting / geopolitical risk / capital flows), used to build macro factor signals that drive cross-asset allocation.

Why use Global Macro on TypingMind?

Because you install it once and use it with any model. Global Macro is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Global Macro in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/HKUDS/Vibe-Trading/tree/main/agent/src/skills/global-macro. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Global Macro?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Global Macro?

As many as you like. As long as a model supports skills, you can use Global Macro with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Global Macro AI skill free?

Yes. It is published on GitHub by HKUDS under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇