0Pricing
AI Prompt Engineering · 강의

금융 및 정량 분석 프롬프트

실적 분석, 위험 점수 산정, SEC 제출 문서 추출 프롬프트를 다룹니다.

금융 및 정량 분석 프롬프트은(는) CoddyKit의 무료 AI Prompt Engineering 강의입니다. 이것은 4개 중 3번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 AI Prompt Engineering 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. AI Prompt Engineering 강의에는 총 4개의 강의가 포함되어 있습니다.

금융 프롬프트 작성의 맥락

금융 분야의 프롬프트 작성은 비정형 문서에서 구조화된 데이터를 추출합니다. 여기에는 실적 보고서, SEC 제출 서류 및 분석가 기록이 포함됩니다. 정확성이 중요합니다. 매출 수치를 잘못 읽거나 성장 방향을 반대로 해석하면 이후 처리에서 심각한 오류가 발생할 수 있습니다.

실적 보고서 추출 프롬프트

실적 보고서는 어느 정도 표준화된 구조를 따릅니다. 대상이 명확한 추출 프롬프트를 사용하면 GAAP 및 비GAAP 방식 모두를 처리하면서 핵심 재무 지표를 정확하게 추출할 수 있습니다.

EARNINGS_EXTRACTION_PROMPT = '''Extract the following financial metrics from the earnings report below.
Return ONLY a JSON object with these exact keys.
If a value is not stated, use null.
Do not calculate or derive values — only extract explicitly stated figures.

Required fields:
- revenue_usd_millions: total net revenue (GAAP)
- revenue_yoy_pct: year-over-year revenue growth percentage
- gross_margin_pct: gross margin percentage (GAAP)
- operating_income_usd_millions: GAAP operating income/loss
- ebitda_usd_millions: Adjusted EBITDA (non-GAAP, if reported)
- net_income_usd_millions: GAAP net income/loss
- eps_diluted: diluted EPS (GAAP)
- eps_adj_diluted: adjusted diluted EPS (non-GAAP, if reported)
- guidance_next_quarter_revenue_low: low end of next quarter revenue guidance
- guidance_next_quarter_revenue_high: high end of next quarter revenue guidance
- fiscal_period: e.g. "Q3 FY2024"

Earnings Report:
{report_text}'''

import anthropic, json
client = anthropic.Anthropic(api_key='YOUR_API_KEY')

def extract_earnings(report_text):
    response = client.messages.create(
        model='claude-opus-4-5', max_tokens=1000,
        messages=[{'role': 'user', 'content':
            EARNINGS_EXTRACTION_PROMPT.format(report_text=report_text)}]
    )
    return json.loads(response.content[0].text)

재무 비율 계산 프롬프트

모델이 재무 비율을 계산하게 하려면 수식을 명시적으로 제공해야 합니다. 모델이 정확한 정의를 알고 있다고 가정하지 마십시오. 분석가마다 약간씩 다른 수식을 사용하기 때문입니다.

RATIO_PROMPT = '''Calculate the following financial ratios using the data provided.
Show your work: state the formula, plug in the numbers, and give the result.
Round all ratios to 2 decimal places.

Ratios to calculate:
1. Gross Margin = (Revenue - COGS) / Revenue * 100
2. Operating Margin = Operating Income / Revenue * 100
3. Net Margin = Net Income / Revenue * 100
4. Current Ratio = Current Assets / Current Liabilities
5. Quick Ratio = (Current Assets - Inventory) / Current Liabilities
6. Debt-to-Equity = Total Debt / Total Shareholders Equity
7. Return on Equity (ROE) = Net Income / Average Shareholders Equity * 100
8. EV/EBITDA = Enterprise Value / EBITDA (if EV is provided)

Financial Data:
{financial_data}'''

def calculate_ratios(financial_data):
    response = client.messages.create(
        model='claude-opus-4-5', max_tokens=2000,
        messages=[{'role': 'user', 'content':
            RATIO_PROMPT.format(financial_data=financial_data)}]
    )
    return response.content[0].text

전년 대비 성장률 추출

YoY 성장률은 절대 변화량이나 백분율 또는 두 가지 모두로 보고될 수 있습니다. 프롬프트는 모든 경우를 처리하고 보고된 성장률과 환율 불변 성장률을 구분해야 합니다.

YOY_PROMPT = '''From the financial document below, extract year-over-year growth metrics.

For each metric found, provide:
- metric_name: e.g. "Revenue", "Gross Profit", "Operating Income"
- current_period: value and period (e.g. "$4.2B, Q3 2024")
- prior_period: value and period (e.g. "$3.8B, Q3 2023")
- yoy_change_pct: percentage change (positive = growth, negative = decline)
- constant_currency_yoy_pct: if reported, the constant-currency growth rate (else null)
- commentary: any management commentary on drivers of the change

IMPORTANT:
- Do not mix GAAP and non-GAAP figures in the same row.
- Mark each row with gaap: true or false.
- If growth is reported only in narrative form (e.g. "revenue grew 15%"),
  still capture it but set current_period and prior_period to null.

Document:
{document_text}'''

def extract_yoy_growth(document_text):
    import json
    response = client.messages.create(
        model='claude-opus-4-5', max_tokens=2000,
        messages=[{'role': 'user', 'content':
            YOY_PROMPT.format(document_text=document_text)}]
    )
    return response.content[0].text

SEC 공시 추출 패턴

SEC 공시(10-K, 10-Q)에는 표준화된 항목 제목이 있습니다. 항목을 인식하는 추출 프롬프트로 특정 항목을 대상으로 지정하면 컨텍스트 창 사용량을 줄이고 정확도를 높일 수 있습니다.

SEC_EXTRACTION_PROMPT = '''You are analyzing a {filing_type} SEC filing.

From {section_name}, extract the following:
{extraction_targets}

Rules:
1. Quote exact figures as stated — do not round or reformat numbers.
2. Note the fiscal year end and reporting currency.
3. If the section uses tables, extract all rows of the table.
4. Flag any restatements: "[RESTATED from prior filing]".
5. Note any forward-looking statements with [FLS] tag.

Filing Section Text:
{section_text}'''

# Section targets by filing type
SECTION_TARGETS = {
    '10-K': {
        'Item 7 MD&A': 'Revenue breakdown by segment, key cost drivers, liquidity discussion',
        'Item 1A Risk Factors': 'Top 5 risks by category (operational, financial, regulatory, competitive)',
        'Item 8 Financial Statements': 'Consolidated income statement, balance sheet key line items'
    },
    '10-Q': {
        'Item 1 Financial Statements': 'Revenue, operating income, cash flow from operations',
        'Item 2 MD&A': 'Quarter-over-quarter and YoY comparisons'
    }
}

def extract_sec_section(filing_type, section_name, section_text):
    targets = SEC_EXTRACTION_TARGETS = SECTION_TARGETS[filing_type][section_name]
    response = client.messages.create(
        model='claude-opus-4-5', max_tokens=3000,
        messages=[{'role': 'user', 'content':
            SEC_EXTRACTION_PROMPT.format(
                filing_type=filing_type, section_name=section_name,
                extraction_targets=targets, section_text=section_text
            )}]
    )
    return response.content[0].text

위험 요인 요약

SEC 공시에는 위험 요인이 50페이지 넘게 포함될 수 있습니다. 위험을 분류하고 순위를 매기는 요약 프롬프트를 사용하면 분석가가 가장 중대한 위험을 빠르게 파악할 수 있습니다.

RISK_FACTOR_PROMPT = '''Summarize the risk factors from this SEC filing.

Categories to use:
1. Financial Risks (liquidity, debt, interest rate, FX)
2. Operational Risks (supply chain, technology, key personnel)
3. Regulatory / Legal Risks (compliance, litigation, government action)
4. Market / Competitive Risks (competition, market conditions, pricing)
5. Macroeconomic Risks (recession, inflation, geopolitical)

For each risk:
- Title: 5-8 word summary
- Category: one of the 5 above
- Materiality: HIGH / MEDIUM / LOW (based on language used: "could significantly...",
  "may adversely affect...", "could result in material...")
- Summary: 2-3 sentence description

Sort each category by Materiality descending.
Limit to top 3 risks per category (15 total max).

Risk Factors Section:
{risk_factors_text}'''

def summarize_risk_factors(risk_factors_text):
    response = client.messages.create(
        model='claude-opus-4-5', max_tokens=3000,
        messages=[{'role': 'user', 'content':
            RISK_FACTOR_PROMPT.format(risk_factors_text=risk_factors_text)}]
    )
    return response.content[0].text

분석가 노트 생성

재무 데이터를 추출하고 분석한 후에는 분석가 스타일의 노트를 생성하여 결과를 요약하십시오. 프롬프트는 전문 금융 분석 보고서의 구조와 객관적인 어조를 준수하도록 강제해야 합니다.

ANALYST_NOTE_PROMPT = '''Write an equity research analyst note for the earnings results below.

STRUCTURE (required sections):
1. Headline: one sentence (include ticker, period, key takeaway, and target price if updated)
2. Investment Thesis: 2-3 sentences on the core bull/bear case
3. Earnings Summary: revenue, gross margin, EPS vs consensus estimates
4. Key Positives: 3 bullet points
5. Key Risks/Concerns: 3 bullet points
6. Guidance Commentary: management outlook, consensus vs guidance delta
7. Valuation: brief note on current multiple vs historical and peers
8. Recommendation: OUTPERFORM / MARKET PERFORM / UNDERPERFORM with 12-month target

TONE: Professional, data-driven, third person. Attribute claims to the company
("Management guided...", "The company reported...").
Do not use vague language — state numbers.

DISCLAIMER: This is AI-generated analysis for informational purposes only.
It does not constitute investment advice. Past performance is not indicative
of future results.

Earnings Data:
{earnings_data}'''

금융 면책 문구 패턴

법률 및 의료 도구와 마찬가지로 금융 AI 도구에도 필수 면책 문구가 필요합니다. 면책 문구가 절대 누락되지 않도록 애플리케이션 계층에서 삽입하십시오.

FINANCIAL_DISCLAIMER = (
    '\n\n---\n'
    'DISCLAIMER: This content is generated by an AI system for informational '
    'and educational purposes only. It does not constitute investment advice, '
    'a solicitation to buy or sell any security, or a recommendation to invest. '
    'Financial data extracted by AI may contain errors — always verify against '
    'primary source filings. Past performance does not guarantee future results. '
    'Consult a licensed financial advisor before making investment decisions.'
)

def get_financial_analysis(prompt):
    response = client.messages.create(
        model='claude-opus-4-5', max_tokens=2000,
        messages=[{'role': 'user', 'content': prompt}]
    )
    raw = response.content[0].text
    return raw + FINANCIAL_DISCLAIMER

# Always use get_financial_analysis() rather than calling the API directly
# to ensure disclaimer is never accidentally omitted

GAAP와 비GAAP 구분

금융 정보 추출에서 가장 흔한 오류 중 하나는 GAAP 수치와 비GAAP 수치를 섞는 것입니다. 프롬프트는 모델이 모든 숫자에 명확한 라벨을 붙이고 불일치를 표시하도록 명시적으로 요구해야 합니다.

GAAP_PROMPT = '''Extract all income statement figures from the text below.
For every number:
- Label it as GAAP or Non-GAAP (Adjusted/Pro Forma)
- If the company reports both, show both on separate rows
- Never combine GAAP and Non-GAAP in a single calculation

Common non-GAAP labels to watch for:
"Adjusted", "Non-GAAP", "Pro Forma", "Normalized", "Underlying",
"Core", "Recurring", "Organic" (for revenue)

Output as a table:
| Metric | GAAP Value | Non-GAAP Value | Period |
|--------|------------|----------------|--------|

Also note in a separate section any reconciliation items between GAAP and Non-GAAP:
- Stock-based compensation
- Amortization of acquired intangibles
- Restructuring charges
- Any other adjustments

Document:
{document_text}'''

print('Always verify GAAP/Non-GAAP labels against the company\'s own reconciliation tables.')

다기간 추세 분석

단일 기간 추출은 한 시점의 모습만 보여 줍니다. 추세 분석 프롬프트는 여러 기간의 지표를 비교하여 변화 방향과 가속 또는 둔화 양상을 드러냅니다.

TREND_PROMPT = '''Analyze the financial trend for {company_name} using the multi-period data below.

1. Create a summary table with these columns:
   | Period | Revenue | Rev Growth YoY | Gross Margin | Op Margin | Net Margin |

2. Identify trends:
   - Is revenue growth accelerating, decelerating, or stable?
   - Margin expansion or compression trend?
   - Any notable inflection points (period where trend changed direction)?

3. Key observations (5 bullet points max):
   - Focus on directional changes, not just absolute numbers
   - Note any seasonality patterns if visible in quarterly data

4. Risks in the trend:
   - Flag any deterioration that management has not addressed
   - Note if guidance implies trend continuation or reversal

Data ({num_periods} periods):
{multi_period_data}'''

def analyze_trend(company_name, multi_period_data, num_periods):
    response = client.messages.create(
        model='claude-opus-4-5', max_tokens=2000,
        messages=[{'role': 'user', 'content':
            TREND_PROMPT.format(
                company_name=company_name,
                multi_period_data=multi_period_data,
                num_periods=num_periods
            )}]
    )
    return response.content[0].text

검증: 추출된 숫자 교차 확인

금융 정보 추출 오류는 위험할 수 있습니다. 회계 항등식(예: 매출총이익 = 매출 - COGS)을 사용해 추출된 숫자를 교차 확인하는 검증 단계를 구축하면 환각이나 추출 오류를 발견할 수 있습니다.

def validate_financials(extracted):
    errors = []

    # Check revenue consistency
    if extracted.get('revenue_usd_millions') and extracted.get('cogs_usd_millions'):
        calc_gp = extracted['revenue_usd_millions'] - extracted['cogs_usd_millions']
        stated_gp = extracted.get('gross_profit_usd_millions')
        if stated_gp and abs(calc_gp - stated_gp) > 1:  # $1M tolerance
            errors.append(
                f'Gross profit mismatch: calculated {calc_gp:.1f}M '
                f'vs stated {stated_gp:.1f}M'
            )

    # Check gross margin consistency
    if extracted.get('revenue_usd_millions') and extracted.get('gross_profit_usd_millions'):
        calc_gm = (extracted['gross_profit_usd_millions'] /
                   extracted['revenue_usd_millions']) * 100
        stated_gm = extracted.get('gross_margin_pct')
        if stated_gm and abs(calc_gm - stated_gm) > 0.5:  # 0.5 pp tolerance
            errors.append(
                f'Gross margin mismatch: calculated {calc_gm:.1f}% '
                f'vs stated {stated_gm:.1f}%'
            )

    return errors

# Always run validation after extraction
errors = validate_financials(extracted_data)
if errors:
    print('Validation errors — manually verify:', errors)
else:
    print('Validation passed')

빠른 확인

실적 보고서에서 재무 지표를 추출할 때 모델이 매출총이익률을 45%라고 반환했지만, 매출과 COGS 수치로 계산하면 매출총이익률이 51%입니다. 어떻게 해야 합니까?

금융 프롬프트 작성 요약

금융 및 정량 프롬프트 작성에는 정확성, 라벨 지정, 검증이 필요합니다:

  • 추출 프롬프트: 정확한 항목 이름을 지정하고 기계 처리를 위해 JSON으로 반환하도록 합니다
  • 수식 명시: 비율을 계산할 때는 항상 정확한 수식을 제공합니다
  • GAAP와 비GAAP: 모든 숫자에 라벨을 붙이고 계산에서 절대 섞지 않습니다
  • SEC 항목: 노이즈를 줄이기 위해 특정 항목을 대상으로 지정합니다
  • 검증: 추출 오류를 발견하기 위해 회계 항등식으로 교차 확인합니다
  • 면책 문구: 애플리케이션 계층에서 투자 관련 면책 문구를 항상 삽입합니다

자주 묻는 질문

“금융 및 정량 분석 프롬프트” 강의는 무료인가요?

네 — “금융 및 정량 분석 프롬프트” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 AI Prompt Engineering 강의 전체를 잠금 해제할 수 있습니다. AI Prompt Engineering 강의에는 총 4개의 강의가 포함되어 있습니다.

“금융 및 정량 분석 프롬프트”에서 뭘 배우나요?

실적 분석, 위험 점수 산정, SEC 제출 문서 추출 프롬프트를 다룹니다. 브라우저에서 직접 실행하는 실습 코드로 AI Prompt Engineering을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

AI Prompt Engineering을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 AI Prompt Engineering은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 3번째 강의입니다.

“금융 및 정량 분석 프롬프트” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 AI Prompt Engineering 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 AI Prompt Engineering 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 법률 분야 프롬프트 패턴
  2. 의료 및 임상 프롬프트 작성
  3. 금융 및 정량 분석 프롬프트
  4. 분야 용어집 및 온톨로지 주입
← AI Prompt Engineering(으)로 돌아가기