Live release feed
Sub-second macro releases for FX backtests
Point-in-time history
Official CPI, jobs, GDP, and central-bank events with point-in-time history.
USD 25/month 14-day free trial
Start Free Trial
두 명의 FX 에이전트를 구성합니다: 연구 에이전트 + 실행 게이트키퍼 image
Share headline card X LinkedIn Email
Download

Reference

Macro Education

두 명의 FX 에이전트를 구성합니다: 연구 에이전트 + 실행 게이트키퍼

실행 승인에서 분석을 분리하여 AI FX 작업 흐름을 더 안전하게 설계합니다. 한 에이전트는 매크로 설정을 조사하고 두 번째 게이트키퍼는 위험 규칙을 적용하고 브로커에 도달하기 전에 안전하지 않은 거래를 차단합니다.

다른 언어로도 제공 English
Share article X LinkedIn Email

두 명의 FX 에이전트를 구성합니다: 연구 에이전트 + 실행 게이트키퍼

저자: FXMacroData 팀
출판된지: May 21, 2026

단일 에이전트 FX 봇은 간단한 이유로 실패합니다. 아이디어를 생성하는 동일한 모델이 또한 그들을 승인 할 수 있습니다. 미국 비농업 고용, 한 가지 추론 오류는 직선으로 직선 위험으로 뛰어 올 수 있습니다.

이 가이드에서는 더 안전한 구조를 보여준다. 두 에이전트 사이에 책임을 분할한다. 첫 번째 에이전트는 시장 연구를 하고 설정을 제안한다. 두 번째 에이젠트는 엄격한 게이트키퍼로, 딱딱한 위험 규칙에 기초한 제안을 승인, 크기를 변경 또는 거부할 수 있다.

결국에는 두 명의 요원들을 위한 실용적인 워크플로우가 될 것입니다. EUR/USD 그리고 GBP/USD 직접 REST API 통합과 MCP 기반 도구 통합을 지원합니다.

목표: "AI 무역 아이디어"에서 "위험 검증된 AI 무역 후보"로 이동하여 모든 중개 행위 전에 의무적인 승인 계층을 시행합니다.

필수 조건

  • 파이썬 3.10+
  • FXMacroData API 키 API 관리- 그래요
  • 연구원들과 관문관들의 LLM 최종점입니다.
  • JSON 및 HTTP API에 대한 기본적인 익숙함

의존성을 설치합니다:

pip install requests python-dotenv pydantic

을 만들자 .env 파일:

FXMD_API_KEY=your_fxmacrodata_key
RESEARCH_MODEL=claude-or-hermes
GATEKEEPER_MODEL=claude-or-hermes
MAX_RISK_PCT=0.50

단계 1: 두 요원 모두에 대한 엄격한 역할을 정의하십시오.

어떻게 해야 할까요? 코드를 작성하기 전에 책임들을 잠금합니다.

  • 연구 담당자: 거시 + 시장 맥락을 읽고 후보 설정을 제안합니다.
  • 게이트키퍼 에이전트: 제한을 확인합니다. 새로운 거래를 발명할 수 없습니다. 승인/ 거부/ 크기를 변경할 수 있습니다.

왜 중요합니까? 이 분리로 인해 신뢰도가 높지만 증거가 약할 때 하나의 모델이 위험 통제를 우회하는 것을 방지합니다.


단계 2: 직접적인 REST 호출을 통해 구조화된 컨텍스트를 뽑으십시오.

어떻게 해야 할까요? FXMacroData에서 발표와 스팟 데이터를 가져오기 때문에 연구원은 구조화되지 않은 헤드라인 대신 깨끗한 입력값을 얻습니다.

curl "https://fxmacrodata.com/api/v1/calendar/usd?api_key=YOUR_API_KEY"
curl "https://fxmacrodata.com/api/v1/announcements/eur/inflation?api_key=YOUR_API_KEY"
curl "https://fxmacrodata.com/api/v1/announcements/gbp/unemployment?api_key=YOUR_API_KEY"
curl "https://fxmacrodata.com/api/v1/forex?base=EUR&quote=USD&api_key=YOUR_API_KEY"

왜 중요합니까? 일관성 있고 구조화된 필드는 두 요인 모두에게 같은 진실의 근원을 제공하고 검증을 결정적으로 만듭니다.

최소 파이썬 수집기:

import os
import requests
from datetime import datetime, timezone

API = "https://fxmacrodata.com/api/v1"
KEY = os.environ["FXMD_API_KEY"]


def fxmd_get(path, **params):
    r = requests.get(
        f"{API}{path}",
        params={"api_key": KEY, **params},
        timeout=25,
    )
    r.raise_for_status()
    return r.json()


def build_market_context():
    return {
        "asof_utc": datetime.now(timezone.utc).isoformat(),
        "calendar_usd": fxmd_get("/calendar/usd").get("data", [])[:8],
        "calendar_eur": fxmd_get("/calendar/eur").get("data", [])[:8],
        "eur_inflation": fxmd_get("/announcements/eur/inflation").get("data", [])[-1:],
        "gbp_unemployment": fxmd_get("/announcements/gbp/unemployment").get("data", [])[-1:],
        "eurusd": fxmd_get("/forex", base="EUR", quote="USD").get("data", [])[-48:],
        "gbpusd": fxmd_get("/forex", base="GBP", quote="USD").get("data", [])[-48:],
    }

단계 3: 연구 대리인과 함께 무역 후보자를 생성

어떻게 해야 할까요? 구조화된 무역 후보에 대한 연구 요원에게만 물어보십시오. 실행 준비가 된 지침을 보내지 마십시오.

{
  "pair": "EUR/USD",
  "bias": "long|short|flat",
  "thesis": "string",
  "confidence": 0.0,
  "entry_zone": "string",
  "invalidation": "string",
  "event_risks": ["string"]
}

왜 중요합니까? 고정된 스키마는 게이트키퍼가 자유형 텍스트를 분석하기 보다는 예측 가능한 필드에 규칙을 적용할 수 있게 합니다.

팁: 중앙은행의 맥락을 포함합니다. 연방준비제도 그리고 은행 검색 프롬프트에서 커뮤니케이션을 유지하지만 최종 출력 컴팩트 유지.

단계 4: 게이트키퍼 에이전트에서 하드 리스크 규칙을 적용하십시오.

어떻게 해야 할까요? 모든 후보자를 두 번째 모델이나 규칙-첫 번째 검증기를 통해 엄격한 제한으로 실행합니다.

정책 예제:

  • 거래당 최대 위험: 자본의 0.50%
  • 15분 이내에 새로운 거래는 없습니다 발매 일정은- 그래요
  • 의무적으로 무효화 수준
  • 신뢰도 < 0.60인 경우 거부합니다.

피단틱 게이트와 결정 출력:

from pydantic import BaseModel, Field


class Candidate(BaseModel):
    pair: str
    bias: str
    thesis: str
    confidence: float = Field(ge=0.0, le=1.0)
    entry_zone: str
    invalidation: str
    event_risks: list[str]


class GateDecision(BaseModel):
    status: str  # approve, resize, reject
    approved_size_pct: float
    reason: str


def gate(candidate: Candidate, max_risk_pct: float = 0.50) -> GateDecision:
    if candidate.confidence < 0.60:
        return GateDecision(status="reject", approved_size_pct=0.0, reason="Low confidence")
    if not candidate.invalidation.strip():
        return GateDecision(status="reject", approved_size_pct=0.0, reason="Missing invalidation")
    proposed = 0.50 if candidate.confidence >= 0.75 else 0.30
    size = min(proposed, max_risk_pct)
    return GateDecision(status="approve", approved_size_pct=size, reason="Within policy")

왜 중요합니까? 연구원이 잘못 읽어도, 관장이 여전히 과대 또는 약한 설정을 차단할 수 있습니다.


단계 5: MCP 통합 경로 (도구 네이티브 에이전트 워크플로우) 를 추가

어떻게 해야 할까요? FXMacroData를 MCP를 통해 노출시켜서 에이전트 프레임워크가 각 봇에 맞춤형 REST 접착제를 만드는 대신 도구를 원생적으로 호출할 수 있습니다.

Python 기반의 MCP 서버를 시작하세요 uvx:

uvx fxmacrodata-mcp --transport http --server-url https://fxmacrodata.com/mcp

클라이언트 구성 예제:

{
  "mcpServers": {
    "fxmacrodata": {
      "command": "uvx",
      "args": [
        "fxmacrodata-mcp",
        "--transport",
        "http",
        "--server-url",
        "https://fxmacrodata.com/mcp"
      ]
    }
  }
}

연구 에이전트의 MCP 도구 호출 스키마 예제:

{
  "name": "get_fx_calendar_and_spot",
  "description": "Get upcoming macro events and current spot context for selected pairs",
  "input_schema": {
    "type": "object",
    "properties": {
      "currencies": {
        "type": "array",
        "items": { "type": "string" }
      },
      "pairs": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "base": { "type": "string" },
            "quote": { "type": "string" }
          },
          "required": ["base", "quote"]
        }
      }
    },
    "required": ["currencies", "pairs"]
  }
}

에이전트 호출 예제 (MCP 경로):

Research Agent:
"Using the fxmacrodata MCP tools, pull today's USD/EUR/GBP calendar and spot for EUR/USD and GBP/USD.
Return up to 3 candidate setups in strict JSON schema."

Gatekeeper Agent:
"Validate each candidate against risk policy v1. Reject anything violating confidence,
size, invalidation, or event-window constraints. Return approve/resize/reject with reason."

왜 중요합니까? MCP는 스택이 커질수록 통합 유동성을 줄여줍니다. 특히 여러 에이전트나 스 모델 제공자를 실행할 때요.


단계 6: 인간 검토로 출력을 라우트, 그 다음 중개 API

어떻게 해야 할까요? 먼저 게이트키퍼 결정을 Slack/Telegram에 보내기 시작하면 초기 버전에서는 인간 확인 후만 승인된 트레이드를 실행 시스템에 전송합니다.

왜 중요합니까? 이것은 감사 가능한 루프를 만들고, 프롬프트 또는 모델 변경 중에 보호합니다.

[FX Two-Agent Candidate]
Pair: EUR/USD
Research Bias: Long
Gatekeeper: Approve
Approved Size: 0.30%
Reason: Confidence 0.71, invalidation present, no high-impact event in 15m window.

당신이 만든

이제 두 개의 에이전트 FX 아키텍처가 있습니다. 아이디어 생성과 위험 승인, 직접 REST 통합을 지원하고 MCP 기반 도구 오케스트레이션을 지원합니다. uvx이것은 단일 에이전트 봇보다 더 강력한 기초입니다. 무역 후보자는 실행 전에 독립적인 정책 게이트를 살아남아야 하기 때문입니다.

다음 단계는 자동으로 강제하는 킬 스위치 레이어를 추가합니다. reject 비정상적인 지연, 데이터 필드 누락, 또는 고 변동성 세션 중 반복 스키마 실패를 통해. 외환 세션 그리고 위치 컨텍스트에서 COT- 그래요

Blogroll

AI Answer-Ready

Key Facts

Page
Build A Two Agent FX Stack Research And Execution Gatekeeper
Section
Articles
Canonical URL
https://fxmacrodata.com/ko/articles/build-a-two-agent-fx-stack-research-and-execution-gatekeeper
Source
FXMacroData editorial and official publisher references
Last Updated
2026-06-15 11:01 UTC

Provenance And Trust

Cite the canonical URL and source field above. Where available, this page maps to official publisher releases and timestamped updates.

Quick Q&A

What is this page about? This page explains Build A Two Agent FX Stack Research And Execution Gatekeeper with directly usable context for trading, research, and API workflows.

What source should be cited? Use the canonical URL and the listed source field; cite official publisher references when available.

How fresh is this content? The last updated value above reflects the page metadata or latest available data timestamp.

Can this be used in AI assistants? Yes. This section is intentionally structured for retrieval and citation in chat assistants.

Prompt Packs

Use these in ChatGPT, Claude, Gemini, Mistral, Perplexity, or Grok for consistent source-aware outputs.