// Equity curve data — language-independent, 2021-05 to 2026-04 (61 points, base=100)
// CL=F: computed from monthly_returns in multi_asset_hmm_bb_rsi_v1_cl_report.json
// SPY/QQQ: monthly close prices normalized, index-0 = 2021-05-01 (prepended 100.0)
window.EQUITY_CURVE = {
  cl:  [100.0,100.0,100.0,108.88,116.75,116.75,116.75,105.12,114.91,114.91,114.91,114.91,114.91,114.91,114.91,114.91,114.91,119.01,125.15,123.43,119.91,119.91,119.91,124.9,124.9,126.95,135.63,135.63,135.63,135.63,142.08,142.84,144.91,144.91,144.91,144.91,144.91,146.29,153.07,154.88,159.08,162.56,162.56,162.56,162.56,162.56,164.43,160.81,160.81,174.21,174.21,174.21,174.21,179.1,182.79,184.24,191.4,191.4,191.4,191.4,191.4],
  spy: [100.0,100.0,102.24,104.74,107.86,102.83,110.04,109.16,114.21,108.18,104.99,108.94,99.38,99.6,91.39,99.8,95.73,86.88,93.94,99.17,93.45,99.33,96.83,100.42,102.02,102.5,109.14,112.71,110.88,105.62,103.33,112.76,117.91,119.79,126.04,130.16,124.91,131.23,135.86,137.51,140.72,143.68,142.39,150.89,147.26,151.21,149.29,140.97,139.75,148.53,156.17,159.76,163.04,168.85,172.87,173.21,173.35,175.9,174.38,165.77,181.01],
  qqq: [100.0,100.0,106.26,109.3,113.91,107.44,115.89,118.2,119.56,109.11,104.22,109.09,94.26,92.76,84.5,95.1,90.22,80.72,83.95,88.6,80.61,89.19,88.87,97.31,97.8,105.51,112.17,116.5,114.77,108.94,106.69,118.23,124.84,127.11,133.82,135.53,129.6,137.57,146.47,144.02,145.61,149.42,148.13,156.06,156.77,160.16,155.83,144.01,146.02,159.42,169.6,173.71,175.37,184.8,193.63,190.61,189.33,191.66,187.17,177.89,199.98],
  // x-axis: indices into the 61-point arrays where each year label is positioned
  // index 0 = 2021-05-01, index 9 = Jan 2022, index 21 = Jan 2023, index 33 = Jan 2024, index 45 = Jan 2025
  yearLabels: ['2021','2022','2023','2024','2025'],
  yearIndices: [0, 9, 21, 33, 45],
};

// Bilingual copy — window.COPY
window.COPY = {
  ja: {
    nav: { products: 'プロダクト', pricing: '料金', install: 'インストール', docs: 'ドキュメント', roadmap: 'ロードマップ', faq: 'FAQ', follow: 'フォロー' },
    hero: {
      tag: '開発進行中',
      h1a: 'アルゴリズムを、',
      h1b: '武器にする。',
      desc: 'バックテスト・最適化・自動執行を一気通貫。AI連携設計の定量的トレーディングシステムを個人トレーダーへ。',
      cta1: '今すぐ購入 — $299',
      cta2: 'プランを見る',
    },
    heroStats: [
      { val: '3', accent: false, lbl: '開発中プロダクト' },
      { val: 'Sharpe 1.09', accent: true, lbl: 'バックテスト実績（CL=F・5年）' },
      { val: '2027', accent: false, lbl: '正式リリース目標' },
    ],
    pricing: {
      label: '料金',
      title: '使い方に合わせて\n選べるプラン',
      subtitle: '買い切り・年額・月額から選べます。Lifetime は将来のバージョンアップ込みです。',
      plans: [
        {
          name: 'Lifetime',
          badge: 'おすすめ',
          featured: true,
          price: '$299',
          period: '買い切り',
          desc: '一度の支払いで将来のメジャーバージョンアップを含む全機能を永続利用。',
          features: [
            'macOS / Linux / Windows 対応',
            'バックテスト（回数無制限）',
            'ベイズ最適化（Optuna）',
            'ウォークフォワード分析',
            'Pine Script v6 自動生成',
            '将来バージョンのアップデート込み',
            '1台のマシンでアクティベート',
          ],
          url: 'https://alforge-labs.lemonsqueezy.com',
        },
        {
          name: 'Annual',
          badge: null,
          featured: false,
          price: '$99',
          period: '/ 年',
          desc: '年間サブスクリプション。常に最新バージョンを利用できます。',
          features: [
            'macOS / Linux / Windows 対応',
            'バックテスト（回数無制限）',
            'ベイズ最適化（Optuna）',
            'ウォークフォワード分析',
            'Pine Script v6 自動生成',
            '常に最新バージョン',
            '1台のマシンでアクティベート',
          ],
          url: 'https://alforge-labs.lemonsqueezy.com',
        },
        {
          name: 'Monthly',
          badge: null,
          featured: false,
          price: '$9',
          period: '/ 月',
          desc: '月額サブスクリプション。必要な期間だけ最新バージョンを利用できます。',
          features: [
            'macOS / Linux / Windows 対応',
            'バックテスト（回数無制限）',
            'ベイズ最適化（Optuna）',
            'ウォークフォワード分析',
            'Pine Script v6 自動生成',
            '常に最新バージョン',
            '1台のマシンでアクティベート',
          ],
          url: 'https://alforge-labs.lemonsqueezy.com',
        },
      ],
      buyNow: '今すぐ購入',
      note: '購入後にライセンスキーが発行されます。インストール後に forge license activate <KEY> で有効化してください。',
    },
    products: {
      label: 'プロダクト',
      title: '3つの層で構成される\n統合トレーディングシステム',
      subtitle: 'バックテストから自動執行まで、一つのエコシステムで完結。',
      items: [
        {
          id: 'forge',
          badge: 'Beta',
          badgeType: 'beta',
          icon: '⚙',
          name: 'forge',
          role: 'バックテスト・最適化エンジン',
          desc: 'JSON定義の戦略をvectorbtで高速バックテスト。Optunaによるベイズ最適化・ウォークフォワード分析で過学習を防ぎ、Pine Script v6を自動生成。Claude連携で戦略を自律探索。',
          tags: ['Python', 'vectorbt', 'Optuna', 'Streamlit', 'Pine Script'],
          accent: 'var(--blue)',
        },
        {
          id: 'strategies',
          badge: 'Alpha',
          badgeType: 'alpha',
          icon: '◈',
          name: 'strategies',
          role: '投資戦略ワークスペース',
          desc: '戦略JSON・バックテスト結果・最適化パラメータ・ジャーナルを一元管理。alpha-forgeのコンフィグレイヤーとして機能。実運用ログの蓄積・分析も対応。',
          tags: ['TradingView', '米国株', 'FX / CFD', 'Pine Script', 'JSON'],
          accent: 'var(--accent)',
        },
        {
          id: 'strike',
          badge: 'Dev',
          badgeType: 'dev',
          icon: '⚡',
          name: 'strike',
          role: 'Webhook・自動発注サーバー',
          desc: 'TradingViewアラートをFastAPIで受け取り、OANDAとmoomoo証券へ自動発注。約定・損益イベントをJSONLで記録。Dockerデプロイ対応。',
          tags: ['FastAPI', 'OANDA', 'moomoo', 'Docker', 'Webhook'],
          accent: 'var(--amber)',
        },
      ],
    },
    perf: {
      label: 'パフォーマンス',
      title: 'バックテスト結果（実データ）',
      strategy: '原油先物（CL=F）HMM + ボリンジャーバンド + RSI 平均回帰戦略',
      period: '2021.05 – 2026.04（5年）',
      note: '※ 実際のバックテスト結果です。手数料0.1%込み。QQQバイ&ホールドの年率リターン（14.9%）は本戦略（13.9%）を上回ります。過去の成績は将来の利益を保証しません。',
      stats: [
        { val: '+13.9%', label: 'CAGR',        cls: 'val-pos' },
        { val: '1.09',   label: 'Sharpe Ratio', cls: 'val-neu' },
        { val: '86.4%',  label: 'Win Rate',     cls: 'val-neu' },
        { val: '-17.0%', label: 'Max Drawdown', cls: 'val-neg' },
        { val: '22回',   label: '取引回数',     cls: 'val-neu' },
      ],
      legend: [
        { color: 'var(--accent)',  label: '本戦略（CL=F）' },
        { color: 'var(--blue)',    label: 'SPY B&H' },
        { color: 'var(--amber)',   label: 'QQQ B&H' },
      ],
      bench: {
        label: 'vs ベンチマーク（同期間）',
        headers: ['', 'SPY B&H', 'QQQ B&H', '本戦略'],
        rows: [
          { metric: 'CAGR',    spy: '12.6%', qqq: '14.9%', strat: '13.9%', stratWin: false },
          { metric: 'Sharpe',  spy: '≈0.5',  qqq: '≈0.5',  strat: '1.09',  stratWin: true },
          { metric: 'Max DD',  spy: '-23.9%',qqq: '-32.6%', strat: '-17.0%',stratWin: true },
        ],
      },
    },
    roadmap: {
      label: 'ロードマップ',
      title: '開発の軌跡と\nこれからの計画',
      items: [
        {
          period: '2025 Q1–Q2',
          status: 'done',
          badgeLabel: '完了',
          title: '基盤構築・初期実装',
          items: ['コアアーキテクチャ設計', 'alpha-forge・alpha-strike・alpha-strategies 初期実装', 'バックテスト・最適化パイプライン構築'],
        },
        {
          period: '2025 Q3–Q4',
          status: 'done',
          badgeLabel: '完了',
          title: '機能拡充・品質向上',
          items: ['Optuna統合・ウォークフォワード分析', 'Web UI (Streamlit) 実装', 'ポートフォリオ管理・レバレッジ取引対応'],
        },
        {
          period: '2025 Q4 – 2026 Q1',
          status: 'done',
          badgeLabel: '完了',
          title: 'ライブトレード統合',
          items: ['OANDA・moomoo証券 自動発注対応', 'ライブトレーディングデータモデル設計', '約定・損益イベント分析パイプライン'],
        },
        {
          period: '2026 Q2–Q3',
          status: 'active',
          badgeLabel: '進行中',
          title: 'ポートフォリオ最適化・安定化',
          items: ['マルチ銘柄ポートフォリオ最適化強化', 'Claude連携による戦略自律探索', 'ドキュメント整備・テストカバレッジ向上'],
        },
        {
          period: '2026 Q4',
          status: 'upcoming',
          badgeLabel: '予定',
          title: 'ベータ版公開',
          items: ['限定ベータテスト開始', 'フィードバック収集・改善', '価格・プラン設計'],
        },
        {
          period: '2027',
          status: 'upcoming',
          badgeLabel: '予定',
          title: '正式リリース・商用化',
          items: ['全プロダクト正式リリース', 'サポート・コミュニティ体制整備'],
        },
      ],
    },
    faq: {
      label: 'FAQ',
      title: 'よくある質問',
      items: [
        { q: 'どんな人向けですか？', a: 'Pythonの基礎知識があり、定量的なアプローチでトレードに取り組みたい個人投資家・トレーダー向けです。JSONで戦略を定義し、CLIで操作できます。将来的にはノーコードオプションも検討中です。' },
        { q: '現在、購入・利用できますか？', a: '現在はクローズドな開発フェーズです。リリース時期はXアカウント (@alforge_bot) でお知らせします。' },
        { q: '対応ブローカーは？', a: '現在はOANDA証券（FX・CFD）とmoomoo証券（米国株・香港株）に対応しています。今後さらなるブローカー拡充を予定しています。' },
        { q: 'TradingViewは必要ですか？', a: 'alpha-strikeの自動執行にはTradingViewのWebhookアラートを利用します。alpha-forgeのバックテスト・最適化はTradingView不要で動作します。' },
        { q: 'alpha-forgeはオープンソースですか？', a: '現在はクローズドでの開発を予定しています。公開方針については今後の開発状況を踏まえて改めてお知らせします。最新情報はX (@alforge_bot) をご確認ください。' },
      ],
    },
    follow: {
      label: 'アップデート',
      title: '開発をリアルタイムで追う',
      desc: '戦略のパフォーマンスレポート・機能アップデート・開発の裏側を定期発信しています。',
      cta: 'X でフォローする',
    },
    disclaimer: {
      title: '⚠️ 重要な免責事項（必ずお読みください）',
      items: [
        { label: 'ソフトウェアの提供', text: '本製品は、バックテストおよび注文の自動化を支援する「ソフトウェアツール」の販売であり、投資助言や特定の銘柄の売買を推奨するものではありません。' },
        { label: '利益の非保証', text: '本ソフトウェアは将来の利益を保証するものではありません。金融市場での取引には元本を失う高いリスクが伴います。' },
        { label: '自己責任', text: 'ライブ口座での自動売買の実行、パラメータの設定、およびシステムトラブルによる損失を含め、すべての取引結果はユーザー自身の責任に帰属します。' },
      ],
    },
    footer: {
      copy: '© 2026 Alforge Labs.',
      note: 'このサイトの情報は投資助言ではありません。',
      links: [
        { label: 'インストール', url: '/install.html' },
        { label: 'ドキュメント', url: '/docs.html' },
        { label: '利用規約', url: '/terms.html' },
        { label: 'プライバシー', url: '/privacy.html' },
      ],
    },
  },

  en: {
    nav: { products: 'Products', pricing: 'Pricing', install: 'Install', docs: 'Docs', roadmap: 'Roadmap', faq: 'FAQ', follow: 'Follow' },
    hero: {
      tag: 'In Development',
      h1a: 'Turn Algorithms',
      h1b: 'Into Edge.',
      desc: 'End-to-end backtesting, optimization, and automated execution. AI-native quantitative trading systems built for serious traders.',
      cta1: 'Buy Now — $299',
      cta2: 'See Plans',
    },
    heroStats: [
      { val: '3', accent: false, lbl: 'Products in Dev' },
      { val: 'Sharpe 1.09', accent: true, lbl: 'Backtest Result (CL=F · 5yr)' },
      { val: '2027', accent: false, lbl: 'Target Release' },
    ],
    pricing: {
      label: 'Pricing',
      title: 'Choose the plan\nthat fits your workflow.',
      subtitle: 'Pick lifetime, annual, or monthly access. Lifetime includes future version updates.',
      plans: [
        {
          name: 'Lifetime',
          badge: 'Best Value',
          featured: true,
          price: '$299',
          period: 'one-time',
          desc: 'Pay once, use forever. All future major version upgrades included.',
          features: [
            'macOS / Linux / Windows',
            'Unlimited backtests',
            'Bayesian optimization (Optuna)',
            'Walk-forward analysis',
            'Pine Script v6 auto-generation',
            'Future version updates included',
            'Activate on 1 machine',
          ],
          url: 'https://alforge-labs.lemonsqueezy.com',
        },
        {
          name: 'Annual',
          badge: null,
          featured: false,
          price: '$99',
          period: '/ year',
          desc: 'Annual subscription. Always on the latest version.',
          features: [
            'macOS / Linux / Windows',
            'Unlimited backtests',
            'Bayesian optimization (Optuna)',
            'Walk-forward analysis',
            'Pine Script v6 auto-generation',
            'Always latest version',
            'Activate on 1 machine',
          ],
          url: 'https://alforge-labs.lemonsqueezy.com',
        },
        {
          name: 'Monthly',
          badge: null,
          featured: false,
          price: '$9',
          period: '/ month',
          desc: 'Monthly subscription. Use the latest version for as long as you need it.',
          features: [
            'macOS / Linux / Windows',
            'Unlimited backtests',
            'Bayesian optimization (Optuna)',
            'Walk-forward analysis',
            'Pine Script v6 auto-generation',
            'Always latest version',
            'Activate on 1 machine',
          ],
          url: 'https://alforge-labs.lemonsqueezy.com',
        },
      ],
      buyNow: 'Buy Now',
      note: 'A license key is issued after purchase. Activate with: forge license activate <KEY>',
    },
    products: {
      label: 'Products',
      title: 'Three layers.\nOne integrated system.',
      subtitle: 'From backtesting to live execution — one ecosystem, end to end.',
      items: [
        {
          id: 'forge',
          badge: 'Beta',
          badgeType: 'beta',
          icon: '⚙',
          name: 'forge',
          role: 'Backtest & Optimization Engine',
          desc: 'Fast strategy backtesting with vectorbt. Bayesian optimization via Optuna + walk-forward analysis to prevent overfitting. Automatic Pine Script v6 generation. Claude integration for autonomous strategy exploration.',
          tags: ['Python', 'vectorbt', 'Optuna', 'Streamlit', 'Pine Script'],
          accent: 'var(--blue)',
        },
        {
          id: 'strategies',
          badge: 'Alpha',
          badgeType: 'alpha',
          icon: '◈',
          name: 'strategies',
          role: 'Strategy Workspace',
          desc: 'Unified management of strategy JSON, backtest results, optimized parameters, and journals. Acts as the config layer for alpha-forge. Supports live trading log accumulation and performance analysis.',
          tags: ['TradingView', 'US Equities', 'FX / CFD', 'Pine Script', 'JSON'],
          accent: 'var(--accent)',
        },
        {
          id: 'strike',
          badge: 'Dev',
          badgeType: 'dev',
          icon: '⚡',
          name: 'strike',
          role: 'Webhook Execution Server',
          desc: 'Receives TradingView alerts via FastAPI and auto-routes orders to OANDA and moomoo. Records fill and PnL events as JSONL. Docker-ready for VPS deployment.',
          tags: ['FastAPI', 'OANDA', 'moomoo', 'Docker', 'Webhook'],
          accent: 'var(--amber)',
        },
      ],
    },
    perf: {
      label: 'Performance',
      title: 'Backtest Results (Live Data)',
      strategy: 'Crude Oil Futures (CL=F) HMM + Bollinger Bands + RSI Mean Reversion',
      period: '2021.05 – 2026.04 (5 years)',
      note: '* Real backtest result with 0.1% commission. QQQ buy-and-hold CAGR (14.9%) exceeds this strategy (13.9%). Past results do not guarantee future performance.',
      stats: [
        { val: '+13.9%', label: 'CAGR',        cls: 'val-pos' },
        { val: '1.09',   label: 'Sharpe Ratio', cls: 'val-neu' },
        { val: '86.4%',  label: 'Win Rate',     cls: 'val-neu' },
        { val: '-17.0%', label: 'Max Drawdown', cls: 'val-neg' },
        { val: '22',     label: 'Total Trades', cls: 'val-neu' },
      ],
      legend: [
        { color: 'var(--accent)', label: 'This Strategy (CL=F)' },
        { color: 'var(--blue)',   label: 'SPY B&H' },
        { color: 'var(--amber)',  label: 'QQQ B&H' },
      ],
      bench: {
        label: 'vs Benchmark (same period)',
        headers: ['', 'SPY B&H', 'QQQ B&H', 'This Strategy'],
        rows: [
          { metric: 'CAGR',    spy: '12.6%', qqq: '14.9%', strat: '13.9%', stratWin: false },
          { metric: 'Sharpe',  spy: '≈0.5',  qqq: '≈0.5',  strat: '1.09',  stratWin: true },
          { metric: 'Max DD',  spy: '-23.9%',qqq: '-32.6%', strat: '-17.0%',stratWin: true },
        ],
      },
    },
    roadmap: {
      label: 'Roadmap',
      title: 'Where we\'ve been\nand where we\'re going.',
      items: [
        { period: '2025 Q1–Q2', status: 'done', badgeLabel: 'Done', title: 'Foundation & Initial Build', items: ['Core architecture design', 'alpha-forge, alpha-strike, alpha-strategies initial implementation', 'Backtest & optimization pipeline'] },
        { period: '2025 Q3–Q4', status: 'done', badgeLabel: 'Done', title: 'Feature Expansion', items: ['Optuna integration + walk-forward analysis', 'Streamlit Web UI', 'Portfolio management & leverage trading support'] },
        { period: '2025 Q4 – 2026 Q1', status: 'done', badgeLabel: 'Done', title: 'Live Trading Integration', items: ['OANDA & moomoo auto-execution', 'Live trading data model design', 'Fill & PnL event analysis pipeline'] },
        { period: '2026 Q2–Q3', status: 'active', badgeLabel: 'Active', title: 'Portfolio Optimization & Stability', items: ['Multi-asset portfolio optimization', 'Claude-driven autonomous strategy search', 'Documentation & test coverage'] },
        { period: '2026 Q4', status: 'upcoming', badgeLabel: 'Planned', title: 'Beta Release', items: ['Closed beta launch', 'Feedback & iteration', 'Pricing model design'] },
        { period: '2027', status: 'upcoming', badgeLabel: 'Planned', title: 'Public Launch', items: ['Full product release', 'Support & community setup'] },
      ],
    },
    faq: {
      label: 'FAQ',
      title: 'Frequently Asked\nQuestions',
      items: [
        { q: 'Who is this for?', a: 'Individual traders and investors with basic Python knowledge who want a systematic, quantitative approach. Strategies are defined in JSON and operated via CLI. No-code options are on the roadmap.' },
        { q: 'Can I use it now?', a: 'We\'re in closed development. Follow @alforge_bot on X for release announcements.' },
        { q: 'Which brokers are supported?', a: 'Currently OANDA (FX, CFD) and moomoo (US equities, HK equities). More brokers are planned.' },
        { q: 'Do I need TradingView?', a: 'alpha-strike uses TradingView Webhook alerts for auto-execution. alpha-forge backtesting and optimization works independently of TradingView.' },
        { q: 'Is alpha-forge open source?', a: 'We plan to keep alpha-forge closed source. Details on our licensing and release model will be shared as development progresses. Follow @alforge_bot for updates.' },
      ],
    },
    follow: {
      label: 'Updates',
      title: 'Follow the build\nin real time.',
      desc: 'Strategy performance reports, feature updates, and behind-the-scenes development shared regularly.',
      cta: 'Follow on X',
    },
    disclaimer: {
      title: '⚠️ Important Disclaimer (Please Read)',
      items: [
        { label: 'Software Provision', text: 'This product is a "software tool" designed to assist with backtesting and order automation. It does not provide investment advice or recommendations for any specific financial instruments.' },
        { label: 'No Guarantee of Profit', text: 'This software does not guarantee future profits. Trading in financial markets involves high risks, including the potential loss of principal.' },
        { label: 'User Responsibility', text: 'All trading results, including those from automated trading in live accounts, parameter settings, and losses due to system issues, are the sole responsibility of the user.' },
      ],
    },
    footer: {
      copy: '© 2026 Alforge Labs.',
      note: 'Nothing on this site constitutes investment advice.',
      links: [
        { label: 'Install', url: '/install.html' },
        { label: 'Docs', url: '/docs.html' },
        { label: 'Terms', url: '/terms.html' },
        { label: 'Privacy', url: '/privacy.html' },
      ],
    },
  },
};
