ai-hedge-fund 3) Cathie Wood

Tasker_Jang·2025년 3월 18일
0

캐시 우드 투자 에이전트: 혁신 기술에 베팅하는 성장주 투자 전략 구현하기

캐시 우드는 ARK 인베스트의 설립자이자 CEO로, 인공지능, 로봇공학, 유전체 시퀀싱, 핀테크, 블록체인 등 혁신적인 기술에 집중 투자하는 것으로 유명합니다. 단기적인 변동성을 감수하고 장기적인 성장 잠재력에 베팅하는 그녀의 투자 전략을 코드로 어떻게 구현했는지 자세히 살펴보겠습니다.

캐시 우드의 투자 철학

캐시 우드의 핵심 투자 원칙은 다음과 같습니다:

  1. 파괴적 혁신 추구: 혁신적인 기술이나 비즈니스 모델을 가진 기업에 집중
  2. 급속한 성장 기회: 빠른 채택 곡선과 거대한 TAM(Total Addressable Market)을 가진 산업 선호
  3. 미래 기술에 집중: AI, 로봇공학, 유전체 시퀀싱, 핀테크, 블록체인 등에 주로 투자
  4. 장기적 관점: 단기적 변동성을 감수하고 장기적인 성장에 집중
  5. 혁신 중심 경영진: R&D에 적극적으로 투자하는 비전 있는 경영진 선호

코드로 살펴보는 캐시 우드 에이전트

def cathie_wood_agent(state: AgentState):
    """
    Analyzes stocks using Cathie Wood's investing principles and LLM reasoning.
    1. Prioritizes companies with breakthrough technologies or business models
    2. Focuses on industries with rapid adoption curves and massive TAM (Total Addressable Market).
    3. Invests mostly in AI, robotics, genomic sequencing, fintech, and blockchain.
    4. Willing to endure short-term volatility for long-term gains.
    """
    data = state["data"]
    end_date = data["end_date"]
    tickers = data["tickers"]

    analysis_data = {}
    cw_analysis = {}

    for ticker in tickers:
        progress.update_status("cathie_wood_agent", ticker, "Fetching financial metrics")
        # 재무 데이터 가져오기
        metrics = get_financial_metrics(ticker, end_date, period="annual", limit=5)

        progress.update_status("cathie_wood_agent", ticker, "Gathering financial line items")
        # 다양한 재무 항목 조회 - R&D 지출, 자본 지출 등 혁신 관련 지표 포함
        financial_line_items = search_line_items(
            ticker,
            [
                "revenue",
                "gross_margin",
                "operating_margin",
                "debt_to_equity",
                "free_cash_flow",
                "total_assets",
                "total_liabilities",
                "dividends_and_other_cash_distributions",
                "outstanding_shares",
                "research_and_development",  # R&D 지출 - 혁신의 핵심 지표
                "capital_expenditure",       # 자본 지출 - 성장 투자 지표
                "operating_expense",         # 운영 비용 - 비용 효율성 지표
            ],
            end_date,
            period="annual",
            limit=5
        )

        progress.update_status("cathie_wood_agent", ticker, "Getting market cap")
        market_cap = get_market_cap(ticker, end_date)

        # 파괴적 잠재력 분석 - 혁신적인 기업인지 평가
        progress.update_status("cathie_wood_agent", ticker, "Analyzing disruptive potential")
        disruptive_analysis = analyze_disruptive_potential(metrics, financial_line_items)

        # 혁신 주도 성장 분석 - 성장 잠재력 평가
        progress.update_status("cathie_wood_agent", ticker, "Analyzing innovation-driven growth")
        innovation_analysis = analyze_innovation_growth(metrics, financial_line_items)

        # 혁신 기업에 적합한 고성장 시나리오 가치 평가
        progress.update_status("cathie_wood_agent", ticker, "Calculating valuation & high-growth scenario")
        valuation_analysis = analyze_cathie_wood_valuation(financial_line_items, market_cap)

        # 부분 점수 종합
        total_score = disruptive_analysis["score"] + innovation_analysis["score"] + valuation_analysis["score"]
        max_possible_score = 15  # 최대 가능 점수

        # 투자 신호 생성 (bullish/neutral/bearish)
        if total_score >= 0.7 * max_possible_score:
            signal = "bullish"
        elif total_score <= 0.3 * max_possible_score:
            signal = "bearish"
        else:
            signal = "neutral"

이 코드는 캐시 우드의 투자 철학을 따라 주식을 분석하는 에이전트의 핵심 로직입니다. 각 종목에 대해 다음과 같은 분석을 수행합니다:

  1. 파괴적 혁신 잠재력 분석
  2. 혁신 주도 성장 분석
  3. 고성장 시나리오에 기반한 가치 평가
  4. 종합 점수 계산 및 투자 신호 생성

파괴적 혁신 잠재력 분석

def analyze_disruptive_potential(metrics: list, financial_line_items: list) -> dict:
    """
    Analyze whether the company has disruptive products, technology, or business model.
    Evaluates multiple dimensions of disruptive potential:
    1. Revenue Growth Acceleration - indicates market adoption
    2. R&D Intensity - shows innovation investment
    3. Gross Margin Trends - suggests pricing power and scalability
    4. Operating Leverage - demonstrates business model efficiency
    5. Market Share Dynamics - indicates competitive position
    """
    score = 0
    details = []

    # 데이터 검증
    if not metrics or not financial_line_items:
        return {
            "score": 0,
            "details": "Insufficient data to analyze disruptive potential"
        }

    # 1. 매출 성장 분석 - 가속화되는 성장 확인
    revenues = [item.revenue for item in financial_line_items if item.revenue]
    if len(revenues) >= 3:  # 가속화 확인에는 최소 3개 기간 필요
        growth_rates = []
        for i in range(len(revenues)-1):
            if revenues[i] and revenues[i+1]:
                growth_rate = (revenues[i+1] - revenues[i]) / abs(revenues[i]) if revenues[i] != 0 else 0
                growth_rates.append(growth_rate)

        # 성장이 가속화되고 있는지 확인
        if len(growth_rates) >= 2 and growth_rates[-1] > growth_rates[0]:
            score += 2
            details.append(f"Revenue growth is accelerating: {(growth_rates[-1]*100):.1f}% vs {(growth_rates[0]*100):.1f}%")

        # 절대 성장률 확인
        latest_growth = growth_rates[-1] if growth_rates else 0
        if latest_growth > 1.0:  # 100% 이상 성장
            score += 3
            details.append(f"Exceptional revenue growth: {(latest_growth*100):.1f}%")
        elif latest_growth > 0.5:  # 50% 이상 성장
            score += 2
            details.append(f"Strong revenue growth: {(latest_growth*100):.1f}%")
        elif latest_growth > 0.2:  # 20% 이상 성장
            score += 1
            details.append(f"Moderate revenue growth: {(latest_growth*100):.1f}%")
    else:
        details.append("Insufficient revenue data for growth analysis")

    # 2. 매출총이익률 분석 - 확장되는 마진 확인
    gross_margins = [item.gross_margin for item in financial_line_items if hasattr(item, 'gross_margin') and item.gross_margin is not None]
    if len(gross_margins) >= 2:
        margin_trend = gross_margins[-1] - gross_margins[0]
        if margin_trend > 0.05:  # 5% 개선
            score += 2
            details.append(f"Expanding gross margins: +{(margin_trend*100):.1f}%")
        elif margin_trend > 0:
            score += 1
            details.append(f"Slightly improving gross margins: +{(margin_trend*100):.1f}%")

        # 절대 마진 수준 확인
        if gross_margins[-1] > 0.50:  # 고마진 사업
            score += 2
            details.append(f"High gross margin: {(gross_margins[-1]*100):.1f}%")
    else:
        details.append("Insufficient gross margin data")

    # 3. 영업 레버리지 분석
    revenues = [item.revenue for item in financial_line_items if item.revenue]
    operating_expenses = [
        item.operating_expense
        for item in financial_line_items
        if hasattr(item, "operating_expense") and item.operating_expense
    ]

    if len(revenues) >= 2 and len(operating_expenses) >= 2:
        rev_growth = (revenues[-1] - revenues[0]) / abs(revenues[0])
        opex_growth = (operating_expenses[-1] - operating_expenses[0]) / abs(operating_expenses[0])

        if rev_growth > opex_growth:
            score += 2
            details.append("Positive operating leverage: Revenue growing faster than expenses")
    else:
        details.append("Insufficient data for operating leverage analysis")

    # 4. R&D 투자 분석
    rd_expenses = [item.research_and_development for item in financial_line_items 
                 if hasattr(item, 'research_and_development') and item.research_and_development is not None]
    if rd_expenses and revenues:
        rd_intensity = rd_expenses[-1] / revenues[-1]
        if rd_intensity > 0.15:  # 높은 R&D 집중도
            score += 3
            details.append(f"High R&D investment: {(rd_intensity*100):.1f}% of revenue")
        elif rd_intensity > 0.08:
            score += 2
            details.append(f"Moderate R&D investment: {(rd_intensity*100):.1f}% of revenue")
        elif rd_intensity > 0.05:
            score += 1
            details.append(f"Some R&D investment: {(rd_intensity*100):.1f}% of revenue")
    else:
        details.append("No R&D data available")

    # 점수 정규화 (5점 만점)
    max_possible_score = 12  # 모든 가능한 점수의 합
    normalized_score = (score / max_possible_score) * 5

    return {
        "score": normalized_score,
        "details": "; ".join(details),
        "raw_score": score,
        "max_score": max_possible_score
    }

파괴적 혁신 잠재력 분석은 기업이 혁신적인 제품, 기술 또는 비즈니스 모델을 가지고 있는지 평가합니다. 주요 평가 항목은 다음과 같습니다:

  1. 매출 성장 가속화: 시장 채택의 징후를 나타냄

    • 성장률이 가속화되고 있는지(후기 성장률 > 초기 성장률)
    • 최근 성장률이 100%, 50%, 20% 이상인지 점수 차등
  2. 매출총이익률 추세: 가격 결정력과 확장성을 나타냄

    • 마진이 확대되고 있는지(5% 이상 개선 시 높은 점수)
    • 절대 마진이 50% 이상으로 높은지
  3. 영업 레버리지: 비즈니스 모델의 효율성을 보여줌

    • 매출 성장이 비용 증가보다 빠른지(긍정적 레버리지)
  4. R&D 투자: 혁신에 대한 투자를 나타냄

    • 매출 대비 R&D 비중이 15%, 8%, 5% 이상인지 점수 차등

혁신 주도 성장 분석

def analyze_innovation_growth(metrics: list, financial_line_items: list) -> dict:
    """
    Evaluate the company's commitment to innovation and potential for exponential growth.
    Analyzes multiple dimensions:
    1. R&D Investment Trends - measures commitment to innovation
    2. Free Cash Flow Generation - indicates ability to fund innovation
    3. Operating Efficiency - shows scalability of innovation
    4. Capital Allocation - reveals innovation-focused management
    5. Growth Reinvestment - demonstrates commitment to future growth
    """
    score = 0
    details = []

    # 데이터 검증
    if not metrics or not financial_line_items:
        return {
            "score": 0,
            "details": "Insufficient data to analyze innovation-driven growth"
        }

    # 1. R&D 투자 추세
    rd_expenses = [
        item.research_and_development
        for item in financial_line_items
        if hasattr(item, "research_and_development") and item.research_and_development
    ]
    revenues = [item.revenue for item in financial_line_items if item.revenue]

    if rd_expenses and revenues and len(rd_expenses) >= 2:
        # R&D 성장률 확인
        rd_growth = (rd_expenses[-1] - rd_expenses[0]) / abs(rd_expenses[0]) if rd_expenses[0] != 0 else 0
        if rd_growth > 0.5:  # R&D 50% 이상 성장
            score += 3
            details.append(f"Strong R&D investment growth: +{(rd_growth*100):.1f}%")
        elif rd_growth > 0.2:
            score += 2
            details.append(f"Moderate R&D investment growth: +{(rd_growth*100):.1f}%")

        # R&D 집중도 추세 확인
        rd_intensity_start = rd_expenses[0] / revenues[0]
        rd_intensity_end = rd_expenses[-1] / revenues[-1]
        if rd_intensity_end > rd_intensity_start:
            score += 2
            details.append(f"Increasing R&D intensity: {(rd_intensity_end*100):.1f}% vs {(rd_intensity_start*100):.1f}%")
    else:
        details.append("Insufficient R&D data for trend analysis")

    # 2. 프리 캐시 플로우 분석
    fcf_vals = [item.free_cash_flow for item in financial_line_items if item.free_cash_flow]
    if fcf_vals and len(fcf_vals) >= 2:
        # FCF 성장 및 일관성 확인
        fcf_growth = (fcf_vals[-1] - fcf_vals[0]) / abs(fcf_vals[0])
        positive_fcf_count = sum(1 for f in fcf_vals if f > 0)

        if fcf_growth > 0.3 and positive_fcf_count == len(fcf_vals):
            score += 3
            details.append("Strong and consistent FCF growth, excellent innovation funding capacity")
        elif positive_fcf_count >= len(fcf_vals) * 0.75:
            score += 2
            details.append("Consistent positive FCF, good innovation funding capacity")
        elif positive_fcf_count > len(fcf_vals) * 0.5:
            score += 1
            details.append("Moderately consistent FCF, adequate innovation funding capacity")
    else:
        details.append("Insufficient FCF data for analysis")

    # 3. 영업 효율성 분석
    op_margin_vals = [item.operating_margin for item in financial_line_items if item.operating_margin]
    if op_margin_vals and len(op_margin_vals) >= 2:
        # 마진 개선 확인
        margin_trend = op_margin_vals[-1] - op_margin_vals[0]

        if op_margin_vals[-1] > 0.15 and margin_trend > 0:
            score += 3
            details.append(f"Strong and improving operating margin: {(op_margin_vals[-1]*100):.1f}%")
        elif op_margin_vals[-1] > 0.10:
            score += 2
            details.append(f"Healthy operating margin: {(op_margin_vals[-1]*100):.1f}%")
        elif margin_trend > 0:
            score += 1
            details.append("Improving operating efficiency")
    else:
        details.append("Insufficient operating margin data")

    # 4. 자본 배분 분석
    capex = [item.capital_expenditure for item in financial_line_items 
           if hasattr(item, 'capital_expenditure') and item.capital_expenditure]
    if capex and revenues and len(capex) >= 2:
        capex_intensity = abs(capex[-1]) / revenues[-1]
        capex_growth = (abs(capex[-1]) - abs(capex[0])) / abs(capex[0]) if capex[0] != 0 else 0

        if capex_intensity > 0.10 and capex_growth > 0.2:
            score += 2
            details.append("Strong investment in growth infrastructure")
        elif capex_intensity > 0.05:
            score += 1
            details.append("Moderate investment in growth infrastructure")
    else:
        details.append("Insufficient CAPEX data")

    # 5. 성장 재투자 분석
    dividends = [item.dividends_and_other_cash_distributions for item in financial_line_items 
               if hasattr(item, 'dividends_and_other_cash_distributions') and item.dividends_and_other_cash_distributions]
    if dividends and fcf_vals:
        # 회사가 배당보다 재투자를 우선시하는지 확인
        latest_payout_ratio = dividends[-1] / fcf_vals[-1] if fcf_vals[-1] != 0 else 1
        if latest_payout_ratio < 0.2:  # 낮은 배당성향은 재투자 집중을 시사
            score += 2
            details.append("Strong focus on reinvestment over dividends")
        elif latest_payout_ratio < 0.4:
            score += 1
            details.append("Moderate focus on reinvestment over dividends")
    else:
        details.append("Insufficient dividend data")

    # 점수 정규화 (5점 만점)
    max_possible_score = 15  # 모든 가능한 점수의 합
    normalized_score = (score / max_possible_score) * 5

    return {
        "score": normalized_score,
        "details": "; ".join(details),
        "raw_score": score,
        "max_score": max_possible_score
    }

혁신 주도 성장 분석은 기업이 혁신에 얼마나 헌신하고 있으며 기하급수적 성장 잠재력이 있는지 평가합니다. 주요 평가 항목은 다음과 같습니다:

  1. R&D 투자 추세: 혁신에 대한 헌신도를 측정

    • R&D 지출 성장률(50% 이상이면 높은 점수)
    • R&D 집중도 증가 여부(R&D/매출 비율)
  2. 프리 캐시 플로우 생성: 혁신 자금 조달 능력 표시

    • FCF 성장성 및 일관성 확인
    • 모든 기간 양의 FCF면 높은 점수
  3. 영업 효율성: 혁신의 확장성 표시

    • 15% 이상의 영업 마진과 개선 추세
    • 10% 이상의 건강한 영업 마진
  4. 자본 배분: 혁신 중심 경영을 나타냄

    • 성장 인프라에 대한 투자 확인(CAPEX/매출 비율)
    • 10% 이상이면 높은 점수
  5. 성장 재투자: 미래 성장에 대한 헌신 보여줌

    • 배당보다 재투자 우선 여부
    • 낮은 배당성향(20% 미만)은 재투자 집중 시사

캐시 우드 스타일 가치 평가

def analyze_cathie_wood_valuation(financial_line_items: list, market_cap: float) -> dict:
    """
    Cathie Wood often focuses on long-term exponential growth potential. We can do
    a simplified approach looking for a large total addressable market (TAM) and the
    company's ability to capture a sizable portion.
    """
    if not financial_line_items or market_cap is None:
        return {
            "score": 0,
            "details": "Insufficient data for valuation"
        }

    latest = financial_line_items[-1]
    fcf = latest.free_cash_flow if latest.free_cash_flow else 0

    if fcf <= 0:
        return {
            "score": 0,
            "details": f"No positive FCF for valuation; FCF = {fcf}",
            "intrinsic_value": None
        }

    # 표준 DCF 대신 혁신 기업에 더 높은 성장률 가정
    # 예시 값:
    growth_rate = 0.20  # 연간 20% 성장
    discount_rate = 0.15
    terminal_multiple = 25
    projection_years = 5

    # 미래 현금흐름의 현재가치 계산
    present_value = 0
    for year in range(1, projection_years + 1):
        future_fcf = fcf * (1 + growth_rate) ** year
        pv = future_fcf / ((1 + discount_rate) ** year)
        present_value += pv

    # 최종 가치 계산
    terminal_value = (fcf * (1 + growth_rate) ** projection_years * terminal_multiple) \
                     / ((1 + discount_rate) ** projection_years)
    intrinsic_value = present_value + terminal_value

    # 안전마진 계산
    margin_of_safety = (intrinsic_value - market_cap) / market_cap

    score = 0
    if margin_of_safety > 0.5:
        score += 3
    elif margin_of_safety > 0.2:
        score += 1

    details = [
        f"Calculated intrinsic value: ~{intrinsic_value:,.2f}",
        f"Market cap: ~{market_cap:,.2f}",
        f"Margin of safety: {margin_of_safety:.2%}"
    ]

    return {
        "score": score,
        "details": "; ".join(details),
        "intrinsic_value": intrinsic_value,
        "margin_of_safety": margin_of_safety
    }

캐시 우드 스타일의 가치 평가는 장기적인 기하급수적 성장 잠재력에 초점을 맞춥니다. 일반적인 가치 투자자보다 더 공격적인 가정을 사용하는 것이 특징입니다:

  1. 높은 성장률 가정: 연간 20% 성장 가정(일반적인 6-10%보다 높음)
  2. 더 높은 할인율: 15% 할인율(높은 성장률에 따른 위험 반영)
  3. 높은 최종 배수: 25배 FCF 배수(일반적인 15배보다 높음)
  4. 안전마진 계산:
    • 50% 이상의 안전마진: 높은 점수
    • 20-50%의 안전마진: 중간 점수

최종 투자 신호 생성

def generate_cathie_wood_output(
    ticker: str,
    analysis_data: dict[str, any],
    model_name: str,
    model_provider: str,
) -> CathieWoodSignal:
    """
    Generates investment decisions in the style of Cathie Wood.
    """
    template = ChatPromptTemplate.from_messages([
        (
            "system",
            """You are a Cathie Wood AI agent, making investment decisions using her principles:\n\n"
            "1. Seek companies leveraging disruptive innovation.\n"
            "2. Emphasize exponential growth potential, large TAM.\n"
            "3. Focus on technology, healthcare, or other future-facing sectors.\n"
            "4. Consider multi-year time horizons for potential breakthroughs.\n"
            "5. Accept higher volatility in pursuit of high returns.\n"
            "6. Evaluate management's vision and ability to invest in R&D.\n\n"
            "Rules:\n"
            "- Identify disruptive or breakthrough technology.\n"
            "- Evaluate strong potential for multi-year revenue growth.\n"
            "- Check if the company can scale effectively in a large market.\n"
            "- Use a growth-biased valuation approach.\n"
            "- Provide a data-driven recommendation (bullish, bearish, or neutral)."""
        ),
        (
            "human",
            """Based on the following analysis, create a Cathie Wood-style investment signal.\n\n"
            "Analysis Data for {ticker}:\n"
            "{analysis_data}\n\n"
            "Return the trading signal in this JSON format:\n"
            "{{\n  \"signal\": \"bullish/bearish/neutral\",\n  \"confidence\": float (0-100),\n  \"reasoning\": \"string\"\n}}"""
        )
    ])

    prompt = template.invoke({
        "analysis_data": json.dumps(analysis_data, indent=2),
        "ticker": ticker
    })

    # LLM 호출 및 결과 반환
    return call_llm(
        prompt=prompt,
        model_name=model_name,
        model_provider=model_provider,
        pydantic_model=CathieWoodSignal,
        agent_name="cathie_wood_agent",
        default_factory=create_default_cathie_wood_signal,
    )

최종적으로, 이 함수는 모든 분석 데이터를 바탕으로 LLM(대형 언어 모델)을 사용하여 캐시 우드 스타일의 투자 신호를 생성합니다. 결과는 다음 형식으로 반환됩니다:

{
  "signal": "bullish/bearish/neutral",
  "confidence": 0-100 사이의 값,
  "reasoning": "투자 결정에 대한 이유"
}
profile
터널을 지나고 있을 뿐, 길은 여전히 열려 있다.

0개의 댓글

관련 채용 정보