Skip to content

"Vibe-Trading: Your Personal Trading Agent"

fix(vnpy-export): update CtaTemplate/BacktestingEngine imports to vn.py 4.0 layout

y859986079a7f60aca5d9
diff --git a/agent/src/skills/vnpy-export/SKILL.md b/agent/src/skills/vnpy-export/SKILL.md
index 14142e14f..a491e7e10 100644
--- a/agent/src/skills/vnpy-export/SKILL.md
+++ b/agent/src/skills/vnpy-export/SKILL.md
@@ -78,7 +78,7 @@ See `scripts/cta_template.py` for a complete, runnable example (MA crossover).
The template below is the canonical skeleton — replace the `# SIGNAL LOGIC` section:
```python
-from vnpy.app.cta_strategy import (
+from vnpy_ctastrategy import (
CtaTemplate,
StopOrder,
TickData,
@@ -270,7 +270,7 @@ To load in vnpy:
To run the vnpy backtester:
```python
-from vnpy.app.cta_backtester import BacktestingEngine
+from vnpy_ctastrategy.backtesting import BacktestingEngine
from vnpy.trader.constant import Interval
engine = BacktestingEngine()
diff --git a/agent/src/skills/vnpy-export/scripts/cta_template.py b/agent/src/skills/vnpy-export/scripts/cta_template.py
index 8fdb664eb..7293e0dce 100644
--- a/agent/src/skills/vnpy-export/scripts/cta_template.py
+++ b/agent/src/skills/vnpy-export/scripts/cta_template.py
@@ -5,14 +5,14 @@ This file is the reference implementation for the vnpy-export skill.
Copy it to your vnpy project's strategies/ folder and adjust parameters.
Requirements:
- pip install vnpy vnpy_ctp (or vnpy_tts for paper trading)
+ pip install vnpy vnpy_ctastrategy vnpy_ctp (or vnpy_tts for paper trading)
Usage in vnpy Trader:
CTA Strategy App → Add Strategy → MaCrossStrategy
Set vt_symbol, e.g. "IF2406.CFFEX" (futures) or "000001.SZSE" (A-share)
"""
-from vnpy.app.cta_strategy import (
+from vnpy_ctastrategy import (
CtaTemplate,
StopOrder,
TickData,