openclaw-stock-analysis 0.2.1 → 0.2.5

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 (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -2
  3. package/dist/index.js +170 -23
  4. package/index.ts +184 -26
  5. package/openclaw.plugin.json +10 -1
  6. package/package.json +1 -1
  7. package/scripts/ci-resolve-llm-host.mjs +29 -0
  8. package/scripts/setup-python.mjs +7 -9
  9. package/skills/event-driven/SKILL.md +6 -0
  10. package/skills/growth-quality/SKILL.md +6 -0
  11. package/skills/hot-theme/SKILL.md +3 -2
  12. package/skills/stock-analysis/SKILL.md +22 -0
  13. package/skills/stock-screener/SKILL.md +19 -1
  14. package/skills/strategy-backtest/SKILL.md +11 -5
  15. package/strategies/examples/bottom_volume.yaml +5 -0
  16. package/strategies/examples/box_oscillation.yaml +5 -0
  17. package/strategies/examples/bull_trend.yaml +11 -3
  18. package/strategies/examples/dragon_head.yaml +4 -2
  19. package/strategies/examples/emotion_cycle.yaml +5 -0
  20. package/strategies/examples/ma_crossover.yaml +10 -3
  21. package/strategies/examples/rsi_oversold.yaml +5 -0
  22. package/strategies/examples/shrink_pullback.yaml +7 -1
  23. package/strategies/examples/volume_breakout.yaml +7 -1
  24. package/tools/_cache.py +61 -0
  25. package/tools/_subproc.py +49 -0
  26. package/tools/alert_rules.py +19 -9
  27. package/tools/anomaly_detect.py +24 -35
  28. package/tools/backtest.py +180 -100
  29. package/tools/capabilities.py +13 -5
  30. package/tools/diagnostics.py +12 -6
  31. package/tools/gather.py +13 -9
  32. package/tools/import_parser.py +2 -5
  33. package/tools/market_regime.py +27 -35
  34. package/tools/market_review.py +56 -9
  35. package/tools/name_resolver.py +2 -5
  36. package/tools/pattern.py +2 -5
  37. package/tools/position_context.py +2 -5
  38. package/tools/report_renderer.py +10 -6
  39. package/tools/requirements.txt +2 -1
  40. package/tools/risk_screening.py +29 -23
  41. package/tools/screener.py +80 -18
  42. package/tools/search_intel.py +5 -13
  43. package/tools/signal_tracker.py +2 -6
  44. package/tools/stock_data.py +612 -177
  45. package/tools/technical.py +136 -40
  46. package/tools/trading_calendar.py +78 -18
  47. package/tools/value_data.py +1368 -0
  48. package/tools/volume_analysis.py +2 -5
  49. package/tools/watchlist.py +2 -5
  50. package/tools/watchlist_context.py +2 -5
@@ -10,6 +10,7 @@ import numpy as np
10
10
 
11
11
  sys.path.insert(0, str(Path(__file__).resolve().parent))
12
12
 
13
+ from _subproc import utf8_stdio # noqa: E402
13
14
  from technical import fetch_kline, to_dataframe # noqa: E402
14
15
 
15
16
 
@@ -150,9 +151,5 @@ def main():
150
151
 
151
152
 
152
153
  if __name__ == "__main__":
153
- # Windows defaults stdio to a legacy code page (cp1252) that cannot encode the
154
- # Chinese text these tools emit — force UTF-8 so stdout never crashes there.
155
- for _s in (sys.stdout, sys.stderr):
156
- if hasattr(_s, "reconfigure"):
157
- _s.reconfigure(encoding="utf-8")
154
+ utf8_stdio()
158
155
  main()
@@ -8,6 +8,7 @@ from concurrent.futures import ThreadPoolExecutor, as_completed
8
8
  from pathlib import Path
9
9
 
10
10
  sys.path.insert(0, str(Path(__file__).resolve().parent))
11
+ from _subproc import utf8_stdio
11
12
  from gather import gather_analysis
12
13
 
13
14
 
@@ -58,9 +59,5 @@ def main():
58
59
 
59
60
 
60
61
  if __name__ == "__main__":
61
- # Windows defaults stdio to a legacy code page (cp1252) that cannot encode the
62
- # Chinese text these tools emit — force UTF-8 so stdout never crashes there.
63
- for _s in (sys.stdout, sys.stderr):
64
- if hasattr(_s, "reconfigure"):
65
- _s.reconfigure(encoding="utf-8")
62
+ utf8_stdio()
66
63
  main()
@@ -14,6 +14,7 @@ from pathlib import Path
14
14
 
15
15
  sys.path.insert(0, str(Path(__file__).resolve().parent))
16
16
  from _subproc import run_tool as _run_json # noqa: E402
17
+ from _subproc import utf8_stdio
17
18
  from stock_data import detect_market # noqa: E402
18
19
  from watchlist import analyze_watchlist # noqa: E402
19
20
 
@@ -150,9 +151,5 @@ def main():
150
151
 
151
152
 
152
153
  if __name__ == "__main__":
153
- # Windows defaults stdio to a legacy code page (cp1252) that cannot encode the
154
- # Chinese text these tools emit — force UTF-8 so stdout never crashes there.
155
- for _s in (sys.stdout, sys.stderr):
156
- if hasattr(_s, "reconfigure"):
157
- _s.reconfigure(encoding="utf-8")
154
+ utf8_stdio()
158
155
  main()