quantwise 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (362) hide show
  1. package/.claude/skills/README.md +80 -0
  2. package/.claude/skills/backtest-expert/SKILL.md +206 -0
  3. package/.claude/skills/backtest-expert/references/failed_tests.md +236 -0
  4. package/.claude/skills/backtest-expert/references/methodology.md +227 -0
  5. package/.claude/skills/breadth-chart-analyst/SKILL.md +583 -0
  6. package/.claude/skills/breadth-chart-analyst/assets/SP500_Breadth_Index_200MA_8MA.jpeg +0 -0
  7. package/.claude/skills/breadth-chart-analyst/assets/US_Stock_Market_Uptrend_Ratio.jpeg +0 -0
  8. package/.claude/skills/breadth-chart-analyst/assets/breadth_analysis_template.md +558 -0
  9. package/.claude/skills/breadth-chart-analyst/references/breadth_chart_methodology.md +590 -0
  10. package/.claude/skills/canslim-screener/SKILL.md +599 -0
  11. package/.claude/skills/canslim-screener/references/canslim_methodology.md +606 -0
  12. package/.claude/skills/canslim-screener/references/fmp_api_endpoints.md +707 -0
  13. package/.claude/skills/canslim-screener/references/interpretation_guide.md +516 -0
  14. package/.claude/skills/canslim-screener/references/scoring_system.md +597 -0
  15. package/.claude/skills/canslim-screener/scripts/calculators/earnings_calculator.py +343 -0
  16. package/.claude/skills/canslim-screener/scripts/calculators/growth_calculator.py +334 -0
  17. package/.claude/skills/canslim-screener/scripts/calculators/institutional_calculator.py +347 -0
  18. package/.claude/skills/canslim-screener/scripts/calculators/leadership_calculator.py +380 -0
  19. package/.claude/skills/canslim-screener/scripts/calculators/market_calculator.py +244 -0
  20. package/.claude/skills/canslim-screener/scripts/calculators/new_highs_calculator.py +194 -0
  21. package/.claude/skills/canslim-screener/scripts/calculators/supply_demand_calculator.py +221 -0
  22. package/.claude/skills/canslim-screener/scripts/finviz_stock_client.py +227 -0
  23. package/.claude/skills/canslim-screener/scripts/fmp_client.py +393 -0
  24. package/.claude/skills/canslim-screener/scripts/report_generator.py +405 -0
  25. package/.claude/skills/canslim-screener/scripts/scorer.py +625 -0
  26. package/.claude/skills/canslim-screener/scripts/screen_canslim.py +361 -0
  27. package/.claude/skills/canslim-screener/scripts/test_institutional_endpoint.py +109 -0
  28. package/.claude/skills/chart/SKILL.md +20 -0
  29. package/.claude/skills/dividend-growth-pullback-screener/SKILL.md +322 -0
  30. package/.claude/skills/dividend-growth-pullback-screener/references/dividend_growth_compounding.md +400 -0
  31. package/.claude/skills/dividend-growth-pullback-screener/references/fmp_api_guide.md +642 -0
  32. package/.claude/skills/dividend-growth-pullback-screener/references/rsi_oversold_strategy.md +333 -0
  33. package/.claude/skills/dividend-growth-pullback-screener/scripts/screen_dividend_growth_rsi.py +1155 -0
  34. package/.claude/skills/earnings-calendar/SKILL.md +721 -0
  35. package/.claude/skills/earnings-calendar/assets/earnings_report_template.md +102 -0
  36. package/.claude/skills/earnings-calendar/references/fmp_api_guide.md +590 -0
  37. package/.claude/skills/earnings-calendar/scripts/fetch_earnings_fmp.py +443 -0
  38. package/.claude/skills/earnings-calendar/scripts/generate_report.py +366 -0
  39. package/.claude/skills/economic-calendar-fetcher/SKILL.md +365 -0
  40. package/.claude/skills/economic-calendar-fetcher/references/fmp_api_documentation.md +345 -0
  41. package/.claude/skills/economic-calendar-fetcher/scripts/get_economic_calendar.py +267 -0
  42. package/.claude/skills/ftd-detector/SKILL.md +147 -0
  43. package/.claude/skills/ftd-detector/references/ftd_methodology.md +188 -0
  44. package/.claude/skills/ftd-detector/references/post_ftd_guide.md +185 -0
  45. package/.claude/skills/ftd-detector/scripts/fmp_client.py +158 -0
  46. package/.claude/skills/ftd-detector/scripts/ftd_detector.py +280 -0
  47. package/.claude/skills/ftd-detector/scripts/post_ftd_monitor.py +404 -0
  48. package/.claude/skills/ftd-detector/scripts/rally_tracker.py +508 -0
  49. package/.claude/skills/ftd-detector/scripts/report_generator.py +341 -0
  50. package/.claude/skills/ftd-detector/scripts/tests/conftest.py +9 -0
  51. package/.claude/skills/ftd-detector/scripts/tests/helpers.py +107 -0
  52. package/.claude/skills/ftd-detector/scripts/tests/test_post_ftd_monitor.py +311 -0
  53. package/.claude/skills/ftd-detector/scripts/tests/test_rally_tracker.py +302 -0
  54. package/.claude/skills/institutional-flow-tracker/README.md +362 -0
  55. package/.claude/skills/institutional-flow-tracker/SKILL.md +357 -0
  56. package/.claude/skills/institutional-flow-tracker/references/13f_filings_guide.md +383 -0
  57. package/.claude/skills/institutional-flow-tracker/references/institutional_investor_types.md +580 -0
  58. package/.claude/skills/institutional-flow-tracker/references/interpretation_framework.md +573 -0
  59. package/.claude/skills/institutional-flow-tracker/scripts/analyze_single_stock.py +457 -0
  60. package/.claude/skills/institutional-flow-tracker/scripts/track_institution_portfolio.py +108 -0
  61. package/.claude/skills/institutional-flow-tracker/scripts/track_institutional_flow.py +450 -0
  62. package/.claude/skills/macro-regime-detector/SKILL.md +86 -0
  63. package/.claude/skills/macro-regime-detector/references/historical_regimes.md +124 -0
  64. package/.claude/skills/macro-regime-detector/references/indicator_interpretation_guide.md +144 -0
  65. package/.claude/skills/macro-regime-detector/references/regime_detection_methodology.md +138 -0
  66. package/.claude/skills/macro-regime-detector/scripts/calculators/__init__.py +1 -0
  67. package/.claude/skills/macro-regime-detector/scripts/calculators/concentration_calculator.py +165 -0
  68. package/.claude/skills/macro-regime-detector/scripts/calculators/credit_conditions_calculator.py +124 -0
  69. package/.claude/skills/macro-regime-detector/scripts/calculators/equity_bond_calculator.py +198 -0
  70. package/.claude/skills/macro-regime-detector/scripts/calculators/sector_rotation_calculator.py +123 -0
  71. package/.claude/skills/macro-regime-detector/scripts/calculators/size_factor_calculator.py +131 -0
  72. package/.claude/skills/macro-regime-detector/scripts/calculators/utils.py +347 -0
  73. package/.claude/skills/macro-regime-detector/scripts/calculators/yield_curve_calculator.py +279 -0
  74. package/.claude/skills/macro-regime-detector/scripts/fmp_client.py +134 -0
  75. package/.claude/skills/macro-regime-detector/scripts/macro_regime_detector.py +278 -0
  76. package/.claude/skills/macro-regime-detector/scripts/report_generator.py +327 -0
  77. package/.claude/skills/macro-regime-detector/scripts/scorer.py +574 -0
  78. package/.claude/skills/macro-regime-detector/scripts/tests/conftest.py +9 -0
  79. package/.claude/skills/macro-regime-detector/scripts/tests/test_concentration.py +78 -0
  80. package/.claude/skills/macro-regime-detector/scripts/tests/test_credit_conditions.py +59 -0
  81. package/.claude/skills/macro-regime-detector/scripts/tests/test_equity_bond.py +74 -0
  82. package/.claude/skills/macro-regime-detector/scripts/tests/test_helpers.py +90 -0
  83. package/.claude/skills/macro-regime-detector/scripts/tests/test_scorer.py +439 -0
  84. package/.claude/skills/macro-regime-detector/scripts/tests/test_sector_rotation.py +78 -0
  85. package/.claude/skills/macro-regime-detector/scripts/tests/test_size_factor.py +59 -0
  86. package/.claude/skills/macro-regime-detector/scripts/tests/test_utils.py +126 -0
  87. package/.claude/skills/macro-regime-detector/scripts/tests/test_yield_curve.py +64 -0
  88. package/.claude/skills/market-breadth-analyzer/SKILL.md +121 -0
  89. package/.claude/skills/market-breadth-analyzer/references/breadth_analysis_methodology.md +168 -0
  90. package/.claude/skills/market-breadth-analyzer/scripts/calculators/__init__.py +1 -0
  91. package/.claude/skills/market-breadth-analyzer/scripts/calculators/bearish_signal_calculator.py +150 -0
  92. package/.claude/skills/market-breadth-analyzer/scripts/calculators/cycle_calculator.py +168 -0
  93. package/.claude/skills/market-breadth-analyzer/scripts/calculators/divergence_calculator.py +119 -0
  94. package/.claude/skills/market-breadth-analyzer/scripts/calculators/historical_context_calculator.py +120 -0
  95. package/.claude/skills/market-breadth-analyzer/scripts/calculators/ma_crossover_calculator.py +115 -0
  96. package/.claude/skills/market-breadth-analyzer/scripts/calculators/trend_level_calculator.py +103 -0
  97. package/.claude/skills/market-breadth-analyzer/scripts/csv_client.py +225 -0
  98. package/.claude/skills/market-breadth-analyzer/scripts/market_breadth_analyzer.py +307 -0
  99. package/.claude/skills/market-breadth-analyzer/scripts/report_generator.py +330 -0
  100. package/.claude/skills/market-breadth-analyzer/scripts/scorer.py +271 -0
  101. package/.claude/skills/market-environment-analysis/SKILL.md +139 -0
  102. package/.claude/skills/market-environment-analysis/references/analysis_patterns.md +124 -0
  103. package/.claude/skills/market-environment-analysis/references/indicators.md +99 -0
  104. package/.claude/skills/market-environment-analysis/scripts/market_utils.py +127 -0
  105. package/.claude/skills/market-news-analyst/SKILL.md +714 -0
  106. package/.claude/skills/market-news-analyst/references/corporate_news_impact.md +446 -0
  107. package/.claude/skills/market-news-analyst/references/geopolitical_commodity_correlations.md +499 -0
  108. package/.claude/skills/market-news-analyst/references/market_event_patterns.md +393 -0
  109. package/.claude/skills/market-news-analyst/references/trusted_news_sources.md +510 -0
  110. package/.claude/skills/market-top-detector/SKILL.md +159 -0
  111. package/.claude/skills/market-top-detector/references/distribution_day_guide.md +100 -0
  112. package/.claude/skills/market-top-detector/references/historical_tops.md +142 -0
  113. package/.claude/skills/market-top-detector/references/market_top_methodology.md +167 -0
  114. package/.claude/skills/market-top-detector/scripts/calculators/__init__.py +17 -0
  115. package/.claude/skills/market-top-detector/scripts/calculators/breadth_calculator.py +116 -0
  116. package/.claude/skills/market-top-detector/scripts/calculators/defensive_rotation_calculator.py +127 -0
  117. package/.claude/skills/market-top-detector/scripts/calculators/distribution_day_calculator.py +161 -0
  118. package/.claude/skills/market-top-detector/scripts/calculators/index_technical_calculator.py +254 -0
  119. package/.claude/skills/market-top-detector/scripts/calculators/leading_stock_calculator.py +198 -0
  120. package/.claude/skills/market-top-detector/scripts/calculators/sentiment_calculator.py +213 -0
  121. package/.claude/skills/market-top-detector/scripts/fmp_client.py +158 -0
  122. package/.claude/skills/market-top-detector/scripts/market_top_detector.py +349 -0
  123. package/.claude/skills/market-top-detector/scripts/report_generator.py +314 -0
  124. package/.claude/skills/market-top-detector/scripts/scorer.py +473 -0
  125. package/.claude/skills/market-top-detector/scripts/tests/conftest.py +9 -0
  126. package/.claude/skills/market-top-detector/scripts/tests/helpers.py +49 -0
  127. package/.claude/skills/market-top-detector/scripts/tests/test_breadth.py +62 -0
  128. package/.claude/skills/market-top-detector/scripts/tests/test_defensive_rotation.py +56 -0
  129. package/.claude/skills/market-top-detector/scripts/tests/test_distribution_day.py +92 -0
  130. package/.claude/skills/market-top-detector/scripts/tests/test_index_technical.py +73 -0
  131. package/.claude/skills/market-top-detector/scripts/tests/test_leading_stock.py +57 -0
  132. package/.claude/skills/market-top-detector/scripts/tests/test_scorer.py +180 -0
  133. package/.claude/skills/market-top-detector/scripts/tests/test_sentiment.py +64 -0
  134. package/.claude/skills/options-strategy-advisor/README.md +469 -0
  135. package/.claude/skills/options-strategy-advisor/SKILL.md +959 -0
  136. package/.claude/skills/options-strategy-advisor/scripts/black_scholes.py +495 -0
  137. package/.claude/skills/pair-trade-screener/README.md +389 -0
  138. package/.claude/skills/pair-trade-screener/SKILL.md +622 -0
  139. package/.claude/skills/pair-trade-screener/references/cointegration_guide.md +745 -0
  140. package/.claude/skills/pair-trade-screener/references/methodology.md +853 -0
  141. package/.claude/skills/pair-trade-screener/scripts/analyze_spread.py +394 -0
  142. package/.claude/skills/pair-trade-screener/scripts/find_pairs.py +535 -0
  143. package/.claude/skills/portfolio-manager/README.md +394 -0
  144. package/.claude/skills/portfolio-manager/SKILL.md +750 -0
  145. package/.claude/skills/portfolio-manager/references/alpaca-mcp-setup.md +367 -0
  146. package/.claude/skills/portfolio-manager/references/asset-allocation.md +502 -0
  147. package/.claude/skills/portfolio-manager/references/diversification-principles.md +553 -0
  148. package/.claude/skills/portfolio-manager/references/portfolio-risk-metrics.md +603 -0
  149. package/.claude/skills/portfolio-manager/references/position-evaluation.md +477 -0
  150. package/.claude/skills/portfolio-manager/references/rebalancing-strategies.md +715 -0
  151. package/.claude/skills/portfolio-manager/references/risk-profile-questionnaire.md +608 -0
  152. package/.claude/skills/portfolio-manager/references/target-allocations.md +558 -0
  153. package/.claude/skills/portfolio-manager/scripts/test_alpaca_connection.py +286 -0
  154. package/.claude/skills/scenario-analyzer/SKILL.md +317 -0
  155. package/.claude/skills/scenario-analyzer/references/headline_event_patterns.md +264 -0
  156. package/.claude/skills/scenario-analyzer/references/scenario_playbooks.md +320 -0
  157. package/.claude/skills/scenario-analyzer/references/sector_sensitivity_matrix.md +217 -0
  158. package/.claude/skills/sector-analyst/SKILL.md +206 -0
  159. package/.claude/skills/sector-analyst/assets/industory_performance_1.jpeg +0 -0
  160. package/.claude/skills/sector-analyst/assets/industory_performance_2.jpeg +0 -0
  161. package/.claude/skills/sector-analyst/assets/sector_performance.jpeg +0 -0
  162. package/.claude/skills/sector-analyst/references/sector_rotation.md +170 -0
  163. package/.claude/skills/stanley-druckenmiller-investment/SKILL.md +84 -0
  164. package/.claude/skills/stanley-druckenmiller-investment/references/case-studies.md +148 -0
  165. package/.claude/skills/stanley-druckenmiller-investment/references/investment-philosophy.md +80 -0
  166. package/.claude/skills/stanley-druckenmiller-investment/references/market-analysis-guide.md +146 -0
  167. package/.claude/skills/stock/NOTION_SETUP.md +33 -0
  168. package/.claude/skills/stock/SKILL.md +38 -0
  169. package/.claude/skills/technical-analyst/SKILL.md +238 -0
  170. package/.claude/skills/technical-analyst/assets/analysis_template.md +183 -0
  171. package/.claude/skills/technical-analyst/references/technical_analysis_framework.md +282 -0
  172. package/.claude/skills/theme-detector/SKILL.md +320 -0
  173. package/.claude/skills/theme-detector/assets/report_template.md +155 -0
  174. package/.claude/skills/theme-detector/references/cross_sector_themes.md +252 -0
  175. package/.claude/skills/theme-detector/references/finviz_industry_codes.md +403 -0
  176. package/.claude/skills/theme-detector/references/thematic_etf_catalog.md +333 -0
  177. package/.claude/skills/theme-detector/references/theme_detection_methodology.md +430 -0
  178. package/.claude/skills/theme-detector/scripts/calculators/__init__.py +1 -0
  179. package/.claude/skills/theme-detector/scripts/calculators/heat_calculator.py +123 -0
  180. package/.claude/skills/theme-detector/scripts/calculators/industry_ranker.py +98 -0
  181. package/.claude/skills/theme-detector/scripts/calculators/lifecycle_calculator.py +172 -0
  182. package/.claude/skills/theme-detector/scripts/calculators/theme_classifier.py +195 -0
  183. package/.claude/skills/theme-detector/scripts/calculators/theme_discoverer.py +280 -0
  184. package/.claude/skills/theme-detector/scripts/config_loader.py +142 -0
  185. package/.claude/skills/theme-detector/scripts/default_theme_config.py +254 -0
  186. package/.claude/skills/theme-detector/scripts/etf_scanner.py +609 -0
  187. package/.claude/skills/theme-detector/scripts/finviz_performance_client.py +131 -0
  188. package/.claude/skills/theme-detector/scripts/report_generator.py +490 -0
  189. package/.claude/skills/theme-detector/scripts/representative_stock_selector.py +673 -0
  190. package/.claude/skills/theme-detector/scripts/scorer.py +87 -0
  191. package/.claude/skills/theme-detector/scripts/tests/README.md +21 -0
  192. package/.claude/skills/theme-detector/scripts/tests/conftest.py +9 -0
  193. package/.claude/skills/theme-detector/scripts/tests/test_config_loader.py +239 -0
  194. package/.claude/skills/theme-detector/scripts/tests/test_etf_scanner.py +810 -0
  195. package/.claude/skills/theme-detector/scripts/tests/test_heat_calculator.py +245 -0
  196. package/.claude/skills/theme-detector/scripts/tests/test_industry_ranker.py +256 -0
  197. package/.claude/skills/theme-detector/scripts/tests/test_lifecycle_calculator.py +301 -0
  198. package/.claude/skills/theme-detector/scripts/tests/test_report_generator.py +624 -0
  199. package/.claude/skills/theme-detector/scripts/tests/test_representative_stock_selector.py +898 -0
  200. package/.claude/skills/theme-detector/scripts/tests/test_scorer.py +185 -0
  201. package/.claude/skills/theme-detector/scripts/tests/test_theme_classifier.py +534 -0
  202. package/.claude/skills/theme-detector/scripts/tests/test_theme_detector_e2e.py +467 -0
  203. package/.claude/skills/theme-detector/scripts/tests/test_theme_discoverer.py +458 -0
  204. package/.claude/skills/theme-detector/scripts/tests/test_uptrend_client.py +76 -0
  205. package/.claude/skills/theme-detector/scripts/theme_detector.py +815 -0
  206. package/.claude/skills/theme-detector/scripts/themes.yaml +168 -0
  207. package/.claude/skills/theme-detector/scripts/uptrend_client.py +241 -0
  208. package/.claude/skills/uptrend-analyzer/SKILL.md +108 -0
  209. package/.claude/skills/uptrend-analyzer/references/uptrend_methodology.md +215 -0
  210. package/.claude/skills/uptrend-analyzer/scripts/calculators/__init__.py +1 -0
  211. package/.claude/skills/uptrend-analyzer/scripts/calculators/historical_context_calculator.py +122 -0
  212. package/.claude/skills/uptrend-analyzer/scripts/calculators/market_breadth_calculator.py +145 -0
  213. package/.claude/skills/uptrend-analyzer/scripts/calculators/momentum_calculator.py +183 -0
  214. package/.claude/skills/uptrend-analyzer/scripts/calculators/sector_participation_calculator.py +204 -0
  215. package/.claude/skills/uptrend-analyzer/scripts/calculators/sector_rotation_calculator.py +218 -0
  216. package/.claude/skills/uptrend-analyzer/scripts/data_fetcher.py +236 -0
  217. package/.claude/skills/uptrend-analyzer/scripts/report_generator.py +329 -0
  218. package/.claude/skills/uptrend-analyzer/scripts/scorer.py +276 -0
  219. package/.claude/skills/uptrend-analyzer/scripts/uptrend_analyzer.py +219 -0
  220. package/.claude/skills/us-market-bubble-detector/CHANGELOG.md +118 -0
  221. package/.claude/skills/us-market-bubble-detector/SKILL.md +545 -0
  222. package/.claude/skills/us-market-bubble-detector/references/bubble_framework.md +335 -0
  223. package/.claude/skills/us-market-bubble-detector/references/historical_cases.md +327 -0
  224. package/.claude/skills/us-market-bubble-detector/references/implementation_guide.md +473 -0
  225. package/.claude/skills/us-market-bubble-detector/references/quick_reference.md +354 -0
  226. package/.claude/skills/us-market-bubble-detector/references/quick_reference_en.md +342 -0
  227. package/.claude/skills/us-market-bubble-detector/scripts/bubble_scorer.py +309 -0
  228. package/.claude/skills/us-stock-analysis/SKILL.md +294 -0
  229. package/.claude/skills/us-stock-analysis/references/financial-metrics.md +172 -0
  230. package/.claude/skills/us-stock-analysis/references/fundamental-analysis.md +129 -0
  231. package/.claude/skills/us-stock-analysis/references/report-template.md +207 -0
  232. package/.claude/skills/us-stock-analysis/references/technical-analysis.md +93 -0
  233. package/.claude/skills/value-dividend-screener/SKILL.md +562 -0
  234. package/.claude/skills/value-dividend-screener/references/fmp_api_guide.md +348 -0
  235. package/.claude/skills/value-dividend-screener/references/screening_methodology.md +315 -0
  236. package/.claude/skills/value-dividend-screener/scripts/screen_dividend_stocks.py +1138 -0
  237. package/.claude/skills/vcp-screener/SKILL.md +79 -0
  238. package/.claude/skills/vcp-screener/references/fmp_api_endpoints.md +45 -0
  239. package/.claude/skills/vcp-screener/references/scoring_system.md +154 -0
  240. package/.claude/skills/vcp-screener/references/vcp_methodology.md +124 -0
  241. package/.claude/skills/vcp-screener/scripts/calculators/__init__.py +1 -0
  242. package/.claude/skills/vcp-screener/scripts/calculators/pivot_proximity_calculator.py +139 -0
  243. package/.claude/skills/vcp-screener/scripts/calculators/relative_strength_calculator.py +161 -0
  244. package/.claude/skills/vcp-screener/scripts/calculators/trend_template_calculator.py +228 -0
  245. package/.claude/skills/vcp-screener/scripts/calculators/vcp_pattern_calculator.py +322 -0
  246. package/.claude/skills/vcp-screener/scripts/calculators/volume_pattern_calculator.py +121 -0
  247. package/.claude/skills/vcp-screener/scripts/fmp_client.py +162 -0
  248. package/.claude/skills/vcp-screener/scripts/report_generator.py +317 -0
  249. package/.claude/skills/vcp-screener/scripts/scorer.py +155 -0
  250. package/.claude/skills/vcp-screener/scripts/screen_vcp.py +536 -0
  251. package/.claude/skills/vcp-screener/scripts/tests/__init__.py +0 -0
  252. package/.claude/skills/vcp-screener/scripts/tests/conftest.py +9 -0
  253. package/.claude/skills/vcp-screener/scripts/tests/test_vcp_screener.py +834 -0
  254. package/.claude/skills/weekly-trade-strategy/.claude/agents/druckenmiller-strategy-planner.md +300 -0
  255. package/.claude/skills/weekly-trade-strategy/.claude/agents/market-news-analyzer.md +239 -0
  256. package/.claude/skills/weekly-trade-strategy/.claude/agents/technical-market-analyst.md +187 -0
  257. package/.claude/skills/weekly-trade-strategy/.claude/agents/us-market-analyst.md +218 -0
  258. package/.claude/skills/weekly-trade-strategy/.claude/agents/weekly-trade-blog-writer.md +318 -0
  259. package/.claude/skills/weekly-trade-strategy/.claude/skills/breadth-chart-analyst/SKILL.md +662 -0
  260. package/.claude/skills/weekly-trade-strategy/.claude/skills/breadth-chart-analyst/assets/SP500_Breadth_Index_200MA_8MA.jpeg +0 -0
  261. package/.claude/skills/weekly-trade-strategy/.claude/skills/breadth-chart-analyst/assets/US_Stock_Market_Uptrend_Ratio.jpeg +0 -0
  262. package/.claude/skills/weekly-trade-strategy/.claude/skills/breadth-chart-analyst/assets/breadth_analysis_template.md +558 -0
  263. package/.claude/skills/weekly-trade-strategy/.claude/skills/breadth-chart-analyst/references/breadth_chart_methodology.md +590 -0
  264. package/.claude/skills/weekly-trade-strategy/.claude/skills/earnings-calendar/SKILL.md +721 -0
  265. package/.claude/skills/weekly-trade-strategy/.claude/skills/earnings-calendar/assets/earnings_report_template.md +102 -0
  266. package/.claude/skills/weekly-trade-strategy/.claude/skills/earnings-calendar/earnings_calendar_2025-11-02.md +447 -0
  267. package/.claude/skills/weekly-trade-strategy/.claude/skills/earnings-calendar/references/fmp_api_guide.md +590 -0
  268. package/.claude/skills/weekly-trade-strategy/.claude/skills/earnings-calendar/scripts/fetch_earnings_fmp.py +443 -0
  269. package/.claude/skills/weekly-trade-strategy/.claude/skills/earnings-calendar/scripts/generate_report.py +366 -0
  270. package/.claude/skills/weekly-trade-strategy/.claude/skills/economic-calendar-fetcher/SKILL.md +365 -0
  271. package/.claude/skills/weekly-trade-strategy/.claude/skills/economic-calendar-fetcher/references/fmp_api_documentation.md +345 -0
  272. package/.claude/skills/weekly-trade-strategy/.claude/skills/economic-calendar-fetcher/scripts/get_economic_calendar.py +267 -0
  273. package/.claude/skills/weekly-trade-strategy/.claude/skills/market-environment-analysis/SKILL.md +139 -0
  274. package/.claude/skills/weekly-trade-strategy/.claude/skills/market-environment-analysis/references/analysis_patterns.md +124 -0
  275. package/.claude/skills/weekly-trade-strategy/.claude/skills/market-environment-analysis/references/indicators.md +99 -0
  276. package/.claude/skills/weekly-trade-strategy/.claude/skills/market-environment-analysis/scripts/market_utils.py +127 -0
  277. package/.claude/skills/weekly-trade-strategy/.claude/skills/market-news-analyst/SKILL.md +714 -0
  278. package/.claude/skills/weekly-trade-strategy/.claude/skills/market-news-analyst/references/corporate_news_impact.md +446 -0
  279. package/.claude/skills/weekly-trade-strategy/.claude/skills/market-news-analyst/references/geopolitical_commodity_correlations.md +499 -0
  280. package/.claude/skills/weekly-trade-strategy/.claude/skills/market-news-analyst/references/market_event_patterns.md +393 -0
  281. package/.claude/skills/weekly-trade-strategy/.claude/skills/market-news-analyst/references/trusted_news_sources.md +510 -0
  282. package/.claude/skills/weekly-trade-strategy/.claude/skills/sector-analyst/SKILL.md +206 -0
  283. package/.claude/skills/weekly-trade-strategy/.claude/skills/sector-analyst/assets/industory_performance_1.jpeg +0 -0
  284. package/.claude/skills/weekly-trade-strategy/.claude/skills/sector-analyst/assets/industory_performance_2.jpeg +0 -0
  285. package/.claude/skills/weekly-trade-strategy/.claude/skills/sector-analyst/assets/sector_performance.jpeg +0 -0
  286. package/.claude/skills/weekly-trade-strategy/.claude/skills/sector-analyst/references/sector_rotation.md +170 -0
  287. package/.claude/skills/weekly-trade-strategy/.claude/skills/stanley-druckenmiller-investment/SKILL.md +84 -0
  288. package/.claude/skills/weekly-trade-strategy/.claude/skills/stanley-druckenmiller-investment/references/case-studies.md +148 -0
  289. package/.claude/skills/weekly-trade-strategy/.claude/skills/stanley-druckenmiller-investment/references/investment-philosophy.md +80 -0
  290. package/.claude/skills/weekly-trade-strategy/.claude/skills/stanley-druckenmiller-investment/references/market-analysis-guide.md +146 -0
  291. package/.claude/skills/weekly-trade-strategy/.claude/skills/technical-analyst/SKILL.md +238 -0
  292. package/.claude/skills/weekly-trade-strategy/.claude/skills/technical-analyst/assets/analysis_template.md +183 -0
  293. package/.claude/skills/weekly-trade-strategy/.claude/skills/technical-analyst/references/technical_analysis_framework.md +282 -0
  294. package/.claude/skills/weekly-trade-strategy/.claude/skills/us-market-bubble-detector/CHANGELOG.md +118 -0
  295. package/.claude/skills/weekly-trade-strategy/.claude/skills/us-market-bubble-detector/SKILL.md +545 -0
  296. package/.claude/skills/weekly-trade-strategy/.claude/skills/us-market-bubble-detector/references/bubble_framework.md +335 -0
  297. package/.claude/skills/weekly-trade-strategy/.claude/skills/us-market-bubble-detector/references/historical_cases.md +327 -0
  298. package/.claude/skills/weekly-trade-strategy/.claude/skills/us-market-bubble-detector/references/implementation_guide.md +473 -0
  299. package/.claude/skills/weekly-trade-strategy/.claude/skills/us-market-bubble-detector/references/quick_reference.md +354 -0
  300. package/.claude/skills/weekly-trade-strategy/.claude/skills/us-market-bubble-detector/references/quick_reference_en.md +342 -0
  301. package/.claude/skills/weekly-trade-strategy/.claude/skills/us-market-bubble-detector/scripts/bubble_scorer.py +309 -0
  302. package/.claude/skills/weekly-trade-strategy/.claude/skills/us-stock-analysis/SKILL.md +294 -0
  303. package/.claude/skills/weekly-trade-strategy/.claude/skills/us-stock-analysis/references/financial-metrics.md +172 -0
  304. package/.claude/skills/weekly-trade-strategy/.claude/skills/us-stock-analysis/references/fundamental-analysis.md +129 -0
  305. package/.claude/skills/weekly-trade-strategy/.claude/skills/us-stock-analysis/references/report-template.md +207 -0
  306. package/.claude/skills/weekly-trade-strategy/.claude/skills/us-stock-analysis/references/technical-analysis.md +93 -0
  307. package/.claude/skills/weekly-trade-strategy/CLAUDE.md +454 -0
  308. package/.claude/skills/weekly-trade-strategy/README.md +287 -0
  309. package/.claude/skills/weekly-trade-strategy/blogs/.gitkeep +0 -0
  310. package/.claude/skills/weekly-trade-strategy/charts/.gitkeep +0 -0
  311. package/.claude/skills/weekly-trade-strategy/earnings_data.json +10054 -0
  312. package/.claude/skills/weekly-trade-strategy/skills/breadth-chart-analyst/SKILL.md +662 -0
  313. package/.claude/skills/weekly-trade-strategy/skills/breadth-chart-analyst/assets/SP500_Breadth_Index_200MA_8MA.jpeg +0 -0
  314. package/.claude/skills/weekly-trade-strategy/skills/breadth-chart-analyst/assets/US_Stock_Market_Uptrend_Ratio.jpeg +0 -0
  315. package/.claude/skills/weekly-trade-strategy/skills/breadth-chart-analyst/assets/breadth_analysis_template.md +558 -0
  316. package/.claude/skills/weekly-trade-strategy/skills/breadth-chart-analyst/references/breadth_chart_methodology.md +590 -0
  317. package/.claude/skills/weekly-trade-strategy/skills/earnings-calendar/SKILL.md +721 -0
  318. package/.claude/skills/weekly-trade-strategy/skills/earnings-calendar/assets/earnings_report_template.md +102 -0
  319. package/.claude/skills/weekly-trade-strategy/skills/earnings-calendar/earnings_calendar_2025-11-02.md +447 -0
  320. package/.claude/skills/weekly-trade-strategy/skills/earnings-calendar/references/fmp_api_guide.md +590 -0
  321. package/.claude/skills/weekly-trade-strategy/skills/earnings-calendar/scripts/fetch_earnings_fmp.py +443 -0
  322. package/.claude/skills/weekly-trade-strategy/skills/earnings-calendar/scripts/generate_report.py +366 -0
  323. package/.claude/skills/weekly-trade-strategy/skills/economic-calendar-fetcher/SKILL.md +365 -0
  324. package/.claude/skills/weekly-trade-strategy/skills/economic-calendar-fetcher/references/fmp_api_documentation.md +345 -0
  325. package/.claude/skills/weekly-trade-strategy/skills/economic-calendar-fetcher/scripts/get_economic_calendar.py +267 -0
  326. package/.claude/skills/weekly-trade-strategy/skills/market-environment-analysis/SKILL.md +139 -0
  327. package/.claude/skills/weekly-trade-strategy/skills/market-environment-analysis/references/analysis_patterns.md +124 -0
  328. package/.claude/skills/weekly-trade-strategy/skills/market-environment-analysis/references/indicators.md +99 -0
  329. package/.claude/skills/weekly-trade-strategy/skills/market-environment-analysis/scripts/market_utils.py +127 -0
  330. package/.claude/skills/weekly-trade-strategy/skills/market-news-analyst/SKILL.md +714 -0
  331. package/.claude/skills/weekly-trade-strategy/skills/market-news-analyst/references/corporate_news_impact.md +446 -0
  332. package/.claude/skills/weekly-trade-strategy/skills/market-news-analyst/references/geopolitical_commodity_correlations.md +499 -0
  333. package/.claude/skills/weekly-trade-strategy/skills/market-news-analyst/references/market_event_patterns.md +393 -0
  334. package/.claude/skills/weekly-trade-strategy/skills/market-news-analyst/references/trusted_news_sources.md +510 -0
  335. package/.claude/skills/weekly-trade-strategy/skills/sector-analyst/SKILL.md +206 -0
  336. package/.claude/skills/weekly-trade-strategy/skills/sector-analyst/assets/industory_performance_1.jpeg +0 -0
  337. package/.claude/skills/weekly-trade-strategy/skills/sector-analyst/assets/industory_performance_2.jpeg +0 -0
  338. package/.claude/skills/weekly-trade-strategy/skills/sector-analyst/assets/sector_performance.jpeg +0 -0
  339. package/.claude/skills/weekly-trade-strategy/skills/sector-analyst/references/sector_rotation.md +170 -0
  340. package/.claude/skills/weekly-trade-strategy/skills/stanley-druckenmiller-investment/SKILL.md +84 -0
  341. package/.claude/skills/weekly-trade-strategy/skills/stanley-druckenmiller-investment/references/case-studies.md +148 -0
  342. package/.claude/skills/weekly-trade-strategy/skills/stanley-druckenmiller-investment/references/investment-philosophy.md +80 -0
  343. package/.claude/skills/weekly-trade-strategy/skills/stanley-druckenmiller-investment/references/market-analysis-guide.md +146 -0
  344. package/.claude/skills/weekly-trade-strategy/skills/technical-analyst/SKILL.md +238 -0
  345. package/.claude/skills/weekly-trade-strategy/skills/technical-analyst/assets/analysis_template.md +183 -0
  346. package/.claude/skills/weekly-trade-strategy/skills/technical-analyst/references/technical_analysis_framework.md +282 -0
  347. package/.claude/skills/weekly-trade-strategy/skills/us-market-bubble-detector/CHANGELOG.md +118 -0
  348. package/.claude/skills/weekly-trade-strategy/skills/us-market-bubble-detector/SKILL.md +545 -0
  349. package/.claude/skills/weekly-trade-strategy/skills/us-market-bubble-detector/references/bubble_framework.md +335 -0
  350. package/.claude/skills/weekly-trade-strategy/skills/us-market-bubble-detector/references/historical_cases.md +327 -0
  351. package/.claude/skills/weekly-trade-strategy/skills/us-market-bubble-detector/references/implementation_guide.md +473 -0
  352. package/.claude/skills/weekly-trade-strategy/skills/us-market-bubble-detector/references/quick_reference.md +354 -0
  353. package/.claude/skills/weekly-trade-strategy/skills/us-market-bubble-detector/references/quick_reference_en.md +342 -0
  354. package/.claude/skills/weekly-trade-strategy/skills/us-market-bubble-detector/scripts/bubble_scorer.py +309 -0
  355. package/.claude/skills/weekly-trade-strategy/skills/us-stock-analysis/SKILL.md +294 -0
  356. package/.claude/skills/weekly-trade-strategy/skills/us-stock-analysis/references/financial-metrics.md +172 -0
  357. package/.claude/skills/weekly-trade-strategy/skills/us-stock-analysis/references/fundamental-analysis.md +129 -0
  358. package/.claude/skills/weekly-trade-strategy/skills/us-stock-analysis/references/report-template.md +207 -0
  359. package/.claude/skills/weekly-trade-strategy/skills/us-stock-analysis/references/technical-analysis.md +93 -0
  360. package/.mcp.json +3 -0
  361. package/cli.mjs +15 -15
  362. package/package.json +4 -2
@@ -0,0 +1,80 @@
1
+ # QuantWise Skills — 投资分析工具集
2
+
3
+ ## 概述
4
+
5
+ 本目录包含 29 个 QuantWise 自定义 Skill,围绕美股投资分析场景构建。通过 `/skill-name` 命令在 QuantWise 交互会话中调用。
6
+
7
+ ## 依赖
8
+
9
+ ### MCP 服务器
10
+
11
+ | 服务器 | 包 / URL | 用途 |
12
+ |--------|----------|------|
13
+ | `stock-analysis` | `stockquotes-mcp` (npx) | 实时行情、OHLCV 数据 |
14
+ | `notion` | `https://mcp.notion.com/mcp` (OAuth) | 数据持久化、历史查询 |
15
+ | `neon` | `@neondatabase/mcp-server-neon` (npx) | 记忆存储 |
16
+
17
+ ### CLI 工具
18
+
19
+ | 工具 | 安装 | 用途 |
20
+ |------|------|------|
21
+ | `candlestick-cli` | `npm i -g candlestick-cli` | 终端 K 线图渲染 |
22
+
23
+ ## Skill 清单
24
+
25
+ ### 核心工具
26
+
27
+ | Skill | 命令 | 说明 |
28
+ |-------|------|------|
29
+ | `stock` | `/stock AAPL` | 股票分析工作站:行情查询、K线图、Notion 存储、深度分析 |
30
+ | `chart` | `/chart AAPL` | 终端 candlestick K 线图 |
31
+ | `us-stock-analysis` | `/us-stock-analysis AAPL` | 综合美股分析(基本面 + 技术面) |
32
+ | `technical-analyst` | `/technical-analyst` | 周线图技术分析 |
33
+
34
+ ### 筛选器
35
+
36
+ | Skill | 说明 |
37
+ |-------|------|
38
+ | `canslim-screener` | William O'Neil CANSLIM 成长股筛选 |
39
+ | `vcp-screener` | Minervini 波动收缩形态(VCP)筛选 |
40
+ | `dividend-growth-pullback-screener` | 高股息增长 + RSI 超卖回调筛选 |
41
+ | `value-dividend-screener` | 价值型高股息筛选 |
42
+ | `pair-trade-screener` | 统计套利配对交易筛选 |
43
+
44
+ ### 市场分析
45
+
46
+ | Skill | 说明 |
47
+ |-------|------|
48
+ | `market-environment-analysis` | 全球市场环境综合分析 |
49
+ | `market-news-analyst` | 近期市场新闻影响分析 |
50
+ | `market-breadth-analyzer` | 市场广度量化评分(0-100) |
51
+ | `breadth-chart-analyst` | 市场广度图表分析 |
52
+ | `market-top-detector` | 市场见顶概率检测 |
53
+ | `us-market-bubble-detector` | 美股泡沫风险评估 |
54
+ | `macro-regime-detector` | 宏观体制转换检测 |
55
+ | `uptrend-analyzer` | 上升趋势健康度分析 |
56
+ | `ftd-detector` | 跟随日(FTD)底部确认信号检测 |
57
+ | `theme-detector` | 市场主题和板块轮动检测 |
58
+ | `sector-analyst` | 板块表现分析 |
59
+
60
+ ### 投资策略
61
+
62
+ | Skill | 说明 |
63
+ |-------|------|
64
+ | `options-strategy-advisor` | 期权策略分析与模拟 |
65
+ | `portfolio-manager` | 投资组合分析(Alpaca 集成) |
66
+ | `institutional-flow-tracker` | 机构持仓变动追踪(13F) |
67
+ | `earnings-calendar` | 财报日历查询 |
68
+ | `economic-calendar-fetcher` | 经济数据日历 |
69
+ | `scenario-analyzer` | 新闻事件 18 个月情景分析 |
70
+ | `stanley-druckenmiller-investment` | Druckenmiller 投资哲学指导 |
71
+ | `backtest-expert` | 量化策略回测指导 |
72
+ | `weekly-trade-strategy` | 周度交易策略综合报告 |
73
+
74
+ ## 数据持久化
75
+
76
+ 使用 Notion 数据库 **Stock Analysis** 存储分析记录。首次使用需创建数据库,参见 [stock/NOTION_SETUP.md](stock/NOTION_SETUP.md)。
77
+
78
+ ## 来源
79
+
80
+ 基于 [tradermonty/claude-trading-skills](https://github.com/tradermonty/claude-trading-skills),在 QuantWise 中使用 `/skill-creator` 工作流进行本地化适配和扩展。
@@ -0,0 +1,206 @@
1
+ ---
2
+ name: backtest-expert
3
+ description: Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.
4
+ ---
5
+
6
+ # Backtest Expert
7
+
8
+ Systematic approach to backtesting trading strategies based on professional methodology that prioritizes robustness over optimistic results.
9
+
10
+ ## Core Philosophy
11
+
12
+ **Goal**: Find strategies that "break the least", not strategies that "profit the most" on paper.
13
+
14
+ **Principle**: Add friction, stress test assumptions, and see what survives. If a strategy holds up under pessimistic conditions, it's more likely to work in live trading.
15
+
16
+ ## When to Use This Skill
17
+
18
+ Use this skill when:
19
+ - Developing or validating systematic trading strategies
20
+ - Evaluating whether a trading idea is robust enough for live implementation
21
+ - Troubleshooting why a backtest might be misleading
22
+ - Learning proper backtesting methodology
23
+ - Avoiding common pitfalls (curve-fitting, look-ahead bias, survivorship bias)
24
+ - Assessing parameter sensitivity and regime dependence
25
+ - Setting realistic expectations for slippage and execution costs
26
+
27
+ ## Backtesting Workflow
28
+
29
+ ### 1. State the Hypothesis
30
+
31
+ Define the edge in one sentence.
32
+
33
+ **Example**: "Stocks that gap up >3% on earnings and pull back to previous day's close within first hour provide mean-reversion opportunity."
34
+
35
+ If you can't articulate the edge clearly, don't proceed to testing.
36
+
37
+ ### 2. Codify Rules with Zero Discretion
38
+
39
+ Define with complete specificity:
40
+ - **Entry**: Exact conditions, timing, price type
41
+ - **Exit**: Stop loss, profit target, time-based exit
42
+ - **Position sizing**: Fixed $$, % of portfolio, volatility-adjusted
43
+ - **Filters**: Market cap, volume, sector, volatility conditions
44
+ - **Universe**: What instruments are eligible
45
+
46
+ **Critical**: No subjective judgment allowed. Every decision must be rule-based and unambiguous.
47
+
48
+ ### 3. Run Initial Backtest
49
+
50
+ Test over:
51
+ - **Minimum 5 years** (preferably 10+)
52
+ - **Multiple market regimes** (bull, bear, high/low volatility)
53
+ - **Realistic costs**: Commissions + conservative slippage
54
+
55
+ Examine initial results for basic viability. If fundamentally broken, iterate on hypothesis.
56
+
57
+ ### 4. Stress Test the Strategy
58
+
59
+ This is where 80% of testing time should be spent.
60
+
61
+ **Parameter sensitivity**:
62
+ - Test stop loss at 50%, 75%, 100%, 125%, 150% of baseline
63
+ - Test profit target at 80%, 90%, 100%, 110%, 120% of baseline
64
+ - Vary entry/exit timing by ±15-30 minutes
65
+ - Look for "plateaus" of stable performance, not narrow spikes
66
+
67
+ **Execution friction**:
68
+ - Increase slippage to 1.5-2x typical estimates
69
+ - Model worst-case fills (buy at ask+1 tick, sell at bid-1 tick)
70
+ - Add realistic order rejection scenarios
71
+ - Test with pessimistic commission structures
72
+
73
+ **Time robustness**:
74
+ - Analyze year-by-year performance
75
+ - Require positive expectancy in majority of years
76
+ - Ensure strategy doesn't rely on 1-2 exceptional periods
77
+ - Test in different market regimes separately
78
+
79
+ **Sample size**:
80
+ - Absolute minimum: 30 trades
81
+ - Preferred: 100+ trades
82
+ - High confidence: 200+ trades
83
+
84
+ ### 5. Out-of-Sample Validation
85
+
86
+ **Walk-forward analysis**:
87
+ 1. Optimize on training period (e.g., Year 1-3)
88
+ 2. Test on validation period (Year 4)
89
+ 3. Roll forward and repeat
90
+ 4. Compare in-sample vs out-of-sample performance
91
+
92
+ **Warning signs**:
93
+ - Out-of-sample <50% of in-sample performance
94
+ - Need frequent parameter re-optimization
95
+ - Parameters change dramatically between periods
96
+
97
+ ### 6. Evaluate Results
98
+
99
+ **Questions to answer**:
100
+ - Does edge survive pessimistic assumptions?
101
+ - Is performance stable across parameter variations?
102
+ - Does strategy work in multiple market regimes?
103
+ - Is sample size sufficient for statistical confidence?
104
+ - Are results realistic, not "too good to be true"?
105
+
106
+ **Decision criteria**:
107
+ - ✅ **Deploy**: Survives all stress tests with acceptable performance
108
+ - 🔄 **Refine**: Core logic sound but needs parameter adjustment
109
+ - ❌ **Abandon**: Fails stress tests or relies on fragile assumptions
110
+
111
+ ## Key Testing Principles
112
+
113
+ ### Punish the Strategy
114
+
115
+ Add friction everywhere:
116
+ - Commissions higher than reality
117
+ - Slippage 1.5-2x typical
118
+ - Worst-case fills
119
+ - Order rejections
120
+ - Partial fills
121
+
122
+ **Rationale**: Strategies that survive pessimistic assumptions often outperform in live trading.
123
+
124
+ ### Seek Plateaus, Not Peaks
125
+
126
+ Look for parameter ranges where performance is stable, not optimal values that create performance spikes.
127
+
128
+ **Good**: Strategy profitable with stop loss anywhere from 1.5% to 3.0%
129
+ **Bad**: Strategy only works with stop loss at exactly 2.13%
130
+
131
+ Stable performance indicates genuine edge; narrow optima suggest curve-fitting.
132
+
133
+ ### Test All Cases, Not Cherry-Picked Examples
134
+
135
+ **Wrong approach**: Study hand-picked "market leaders" that worked
136
+ **Right approach**: Test every stock that met criteria, including those that failed
137
+
138
+ Selective examples create survivorship bias and overestimate strategy quality.
139
+
140
+ ### Separate Idea Generation from Validation
141
+
142
+ **Intuition**: Useful for generating hypotheses
143
+ **Validation**: Must be purely data-driven
144
+
145
+ Never let attachment to an idea influence interpretation of test results.
146
+
147
+ ## Common Failure Patterns
148
+
149
+ Recognize these patterns early to save time:
150
+
151
+ 1. **Parameter sensitivity**: Only works with exact parameter values
152
+ 2. **Regime-specific**: Great in some years, terrible in others
153
+ 3. **Slippage sensitivity**: Unprofitable when realistic costs added
154
+ 4. **Small sample**: Too few trades for statistical confidence
155
+ 5. **Look-ahead bias**: "Too good to be true" results
156
+ 6. **Over-optimization**: Many parameters, poor out-of-sample results
157
+
158
+ See `references/failed_tests.md` for detailed examples and diagnostic framework.
159
+
160
+ ## Available Reference Documentation
161
+
162
+ ### Methodology Reference
163
+ **File**: `references/methodology.md`
164
+
165
+ **When to read**: For detailed guidance on specific testing techniques.
166
+
167
+ **Contents**:
168
+ - Stress testing methods
169
+ - Parameter sensitivity analysis
170
+ - Slippage and friction modeling
171
+ - Sample size requirements
172
+ - Market regime classification
173
+ - Common biases and pitfalls (survivorship, look-ahead, curve-fitting, etc.)
174
+
175
+ ### Failed Tests Reference
176
+ **File**: `references/failed_tests.md`
177
+
178
+ **When to read**: When strategy fails tests, or learning from past mistakes.
179
+
180
+ **Contents**:
181
+ - Why failures are valuable
182
+ - Common failure patterns with examples
183
+ - Case study documentation framework
184
+ - Red flags checklist for evaluating backtests
185
+
186
+ ## Critical Reminders
187
+
188
+ **Time allocation**: Spend 20% generating ideas, 80% trying to break them.
189
+
190
+ **Context-free requirement**: If strategy requires "perfect context" to work, it's not robust enough for systematic trading.
191
+
192
+ **Red flag**: If backtest results look too good (>90% win rate, minimal drawdowns, perfect timing), audit carefully for look-ahead bias or data issues.
193
+
194
+ **Tool limitations**: Understand your backtesting platform's quirks (interpolation methods, handling of low liquidity, data alignment issues).
195
+
196
+ **Statistical significance**: Small edges require large sample sizes to prove. 5% edge per trade needs 100+ trades to distinguish from luck.
197
+
198
+ ## Discretionary vs Systematic Differences
199
+
200
+ This skill focuses on **systematic/quantitative** backtesting where:
201
+ - All rules are codified in advance
202
+ - No discretion or "feel" in execution
203
+ - Testing happens on all historical examples, not cherry-picked cases
204
+ - Context (news, macro) is deliberately stripped out
205
+
206
+ Discretionary traders study differently—this skill may not apply to setups requiring subjective judgment.
@@ -0,0 +1,236 @@
1
+ # Learning from Failed Backtests
2
+
3
+ ## Table of Contents
4
+
5
+ 1. Why Failed Ideas Are Valuable
6
+ 2. Common Failure Patterns
7
+ 3. Case Study Framework
8
+ 4. Red Flags Checklist
9
+
10
+ ## 1. Why Failed Ideas Are Valuable
11
+
12
+ ### The Value of Failures
13
+
14
+ **Key insights**:
15
+ - Failed tests save capital by preventing live implementation
16
+ - Failure patterns reveal which assumptions don't hold
17
+ - Understanding what doesn't work narrows the search space
18
+ - Failed tests build experience in recognizing fragile strategies
19
+
20
+ ### Documentation Discipline
21
+
22
+ **Record for each failed idea**:
23
+ - The hypothesis being tested
24
+ - Why you thought it would work
25
+ - What the data showed
26
+ - Specific breaking points
27
+ - Lessons learned
28
+
29
+ **Purpose**: Build a library of "anti-patterns" to avoid repeating mistakes.
30
+
31
+ ## 2. Common Failure Patterns
32
+
33
+ ### Pattern 1: Parameter Sensitivity
34
+
35
+ **Symptom**: Strategy only works with very specific parameter values.
36
+
37
+ **Example scenario**:
38
+ - Strategy profitable with stop loss at exactly 2.5%
39
+ - Increasing to 3% or decreasing to 2% causes significant performance drop
40
+ - No "plateau" of stable performance
41
+
42
+ **Why it fails**: Real markets have noise; if small changes break the strategy, it likely captured noise, not signal.
43
+
44
+ **Lesson**: Seek strategies with stable performance across parameter ranges.
45
+
46
+ ### Pattern 2: Regime-Specific Performance
47
+
48
+ **Symptom**: Strategy works brilliantly in some years, terribly in others.
49
+
50
+ **Example scenario**:
51
+ - Great performance in 2017-2019 (low volatility bull market)
52
+ - Catastrophic losses in 2020 (high volatility)
53
+ - Poor performance in 2022 (downtrend)
54
+
55
+ **Why it fails**: Strategy dependent on specific market conditions, not robust enough for diverse environments.
56
+
57
+ **Lesson**: Require acceptable (not necessarily best) performance across all regimes.
58
+
59
+ ### Pattern 3: Slippage Sensitivity
60
+
61
+ **Symptom**: Strategy becomes unprofitable when realistic trading costs added.
62
+
63
+ **Example scenario**:
64
+ - Backtest shows 0.5% average gain per trade
65
+ - Adding 0.1% slippage per side (0.2% round-trip) eliminates profits
66
+ - Strategy requires unrealistic fills to be profitable
67
+
68
+ **Why it fails**: Edge too small to survive real-world friction.
69
+
70
+ **Lesson**: Edge must be large enough to survive pessimistic assumptions about costs.
71
+
72
+ ### Pattern 4: Sample Size Issues
73
+
74
+ **Symptom**: Strong results based on small number of trades.
75
+
76
+ **Example scenario**:
77
+ - Backtest shows 80% win rate
78
+ - Only 15 total trades in 5 years
79
+ - A few different outcomes would dramatically change results
80
+
81
+ **Why it fails**: Insufficient data to distinguish edge from luck.
82
+
83
+ **Lesson**: Require minimum 100 trades for meaningful conclusions, preferably 200+.
84
+
85
+ ### Pattern 5: Look-Ahead Bias
86
+
87
+ **Symptom**: Perfect or near-perfect backtest results.
88
+
89
+ **Example scenario**:
90
+ - Strategy shows 95%+ win rate
91
+ - Unrealistically good entry/exit timing
92
+ - Performance too good to be realistic
93
+
94
+ **Why it fails**: Likely using information not available at time of trade.
95
+
96
+ **Lesson**: Be suspicious of "too good to be true" results; audit data alignment carefully.
97
+
98
+ ### Pattern 6: Over-Optimization (Curve Fitting)
99
+
100
+ **Symptom**: Complex strategy with many parameters shows excellent in-sample results but poor out-of-sample.
101
+
102
+ **Example scenario**:
103
+ - Strategy uses 8-10 different indicators with specific thresholds
104
+ - In-sample performance: 40% annual return
105
+ - Out-of-sample performance: -5% annual return
106
+ - Parameters needed constant re-optimization
107
+
108
+ **Why it fails**: Fitted to historical noise rather than genuine market structure.
109
+
110
+ **Lesson**: Prefer simple strategies with fewer parameters; demand strong out-of-sample results.
111
+
112
+ ## 3. Case Study Framework
113
+
114
+ ### Template for Documenting Failed Ideas
115
+
116
+ Use this framework when a backtest fails:
117
+
118
+ #### 1. Initial Hypothesis
119
+ - **What edge were you trying to capture?**
120
+ - **Why did you think this would work?**
121
+ - **What was the logical basis?**
122
+
123
+ #### 2. Implementation Details
124
+ - **Entry rules** (specific and complete)
125
+ - **Exit rules** (stop loss, profit target, time-based)
126
+ - **Position sizing**
127
+ - **Filters or conditions**
128
+
129
+ #### 3. Test Results
130
+ - **Basic metrics**:
131
+ - Total trades
132
+ - Win rate
133
+ - Average win/loss
134
+ - Max drawdown
135
+ - Annual returns by year
136
+
137
+ - **Parameter sensitivity**:
138
+ - How results changed with parameter variations
139
+ - Whether "plateau" of stable performance existed
140
+
141
+ - **Regime analysis**:
142
+ - Performance in different market conditions
143
+ - Which regimes caused problems
144
+
145
+ #### 4. Breaking Points
146
+ - **What specifically caused the strategy to fail?**
147
+ - Slippage too high?
148
+ - Parameter sensitivity?
149
+ - Regime-specific?
150
+ - Insufficient sample size?
151
+
152
+ #### 5. Lessons Learned
153
+ - **What assumptions were wrong?**
154
+ - **What would you test differently next time?**
155
+ - **Are there salvageable elements?**
156
+
157
+ ### Example: Failed Momentum Reversal Strategy
158
+
159
+ #### 1. Initial Hypothesis
160
+ Tried to capture mean reversion after strong momentum moves. Hypothesis: Stocks that gap up 5%+ on earnings often pull back 2-3% before continuing, providing short-term reversal opportunity.
161
+
162
+ #### 2. Implementation
163
+ - Entry: Short when stock gaps up 5%+ on earnings at market open
164
+ - Exit: Cover at 2% profit or 3% stop loss
165
+ - Holding period: Maximum 3 days
166
+ - Filters: Market cap >$2B, average volume >500K shares
167
+
168
+ #### 3. Test Results
169
+ - 67 trades over 5 years
170
+ - Win rate: 58%
171
+ - Avg win: 2.1%, Avg loss: 3.2%
172
+ - Max drawdown: 18%
173
+ - 2019-2021: Profitable
174
+ - 2022-2023: Significant losses
175
+
176
+ #### 4. Breaking Points
177
+ - Strategy failed during strong momentum environments (2021 meme stocks)
178
+ - Stop losses hit frequently during continued upward momentum
179
+ - Gap-ups that continued higher immediately caused outsized losses
180
+ - Small sample size (67 trades) provided low statistical confidence
181
+ - Slippage on short entries during high volatility eliminated thin edge
182
+
183
+ #### 5. Lessons Learned
184
+ - Mean reversion strategies vulnerable during momentum regimes
185
+ - Need regime filter (e.g., only trade during high VIX or weak market)
186
+ - 5-year test insufficient for momentum strategies; need 10+ years
187
+ - Edge too small (2% target vs 3% stop) to survive slippage
188
+ - Better approach: Wait for actual pullback, then enter, rather than fade immediately
189
+
190
+ ## 4. Red Flags Checklist
191
+
192
+ Use this checklist when evaluating any backtest:
193
+
194
+ ### Data Quality Issues
195
+ - [ ] Has survivorship bias been addressed?
196
+ - [ ] Are delisted stocks included in test?
197
+ - [ ] Is data alignment correct (no look-ahead bias)?
198
+ - [ ] Are corporate actions (splits, dividends) handled correctly?
199
+
200
+ ### Sample Size Concerns
201
+ - [ ] At least 100 trades? (Preferably 200+)
202
+ - [ ] At least 5 years of data? (Preferably 10+)
203
+ - [ ] Includes full market cycle?
204
+ - [ ] Tested across multiple market regimes?
205
+
206
+ ### Parameter Robustness
207
+ - [ ] Does strategy work with nearby parameter values?
208
+ - [ ] Are there "plateaus" of stable performance?
209
+ - [ ] Minimal parameters (ideally <5)?
210
+ - [ ] Parameters based on logical reasoning, not pure optimization?
211
+
212
+ ### Execution Realism
213
+ - [ ] Realistic commissions included?
214
+ - [ ] Slippage modeled conservatively (1.5-2x typical)?
215
+ - [ ] Worst-case fills considered?
216
+ - [ ] Order rejection/partial fills addressed?
217
+
218
+ ### Performance Characteristics
219
+ - [ ] Positive expectancy in majority of years?
220
+ - [ ] Acceptable performance in all major regimes?
221
+ - [ ] No catastrophic drawdowns (>50%)?
222
+ - [ ] Edge large enough to survive friction?
223
+
224
+ ### Bias Prevention
225
+ - [ ] Strategy defined before testing?
226
+ - [ ] Hypothesis has economic logic?
227
+ - [ ] Results aren't "too good to be true"?
228
+ - [ ] Out-of-sample testing performed?
229
+ - [ ] No cherry-picking of examples?
230
+
231
+ ### Tool Limitations
232
+ - [ ] Aware of testing platform's interpolation methods?
233
+ - [ ] Understand how platform handles low-liquidity situations?
234
+ - [ ] Know quirks specific to data provider?
235
+
236
+ **If more than 2-3 items aren't checked, the backtest requires additional work before considering live implementation.**