Export a Vibe-Trading backtest strategy to a runnable vnpy CtaTemplate Python class — supports A-share equities, futures, and crypto via BarGenerator + Array…
npx clawhub@latest install vnpy-exportVnpy Export translates a Vibe-Trading backtest strategy into a runnable vnpy CtaTemplate subclass .py file, ready to load into vnpy's CTA Strategy App for live trading or backtesting. It supports A-share equities, futures, and crypto via vnpy's BarGenerator and ArrayManager primitives. Install this skill when you want to move a strategy from Vibe-Trading into vnpy — the most widely-used open-source quant framework in mainland China (39k+ GitHub stars) — without hand-writing boilerplate.
npx clawhub@latest install vnpy-exportClick the Install button at the top of this page for one-click setup
.py file loadable in the vnpy CTA Strategy App.BacktestingEngine with proper parameter and variable declarations.*.SZSE / *.SSE), Chinese futures (*.CFFEX, *.SHFE, etc.), or crypto (*.BINANCE) and need the correct vnpy conventions for each asset class.CtaTemplate subclass from scratch.CtaTemplate subclasses.on_bar / on_tick flow without significant manual rework.Reads config.json and code/signal_engine.py from an existing Vibe-Trading run, then translates the full signal logic into a CtaTemplate subclass saved to artifacts/vnpy_strategy/<StrategyName>Strategy.py.
When no backtest run exists, generates a compliant CtaTemplate class directly from a plain-language strategy description and writes it to the same output path.
Automatically applies the correct vt_symbol format, position units, and order direction rules for A-share stocks (buy/sell only), futures (all four directions), and crypto — no manual adjustment needed.
Maps common pandas and TA-Lib indicator calls (rolling mean, EWM, RSI, MACD, Bollinger Bands, ATR, Donchian, and more) to their ArrayManager equivalents, avoiding look-ahead bias and improving runtime performance.
Handles strategies that combine multiple timeframes (e.g., daily trend filter + intraday entry) by wiring multiple BarGenerator and ArrayManager instances with the correct callback chain.
Before saving, validates the output against a built-in checklist: correct class naming, matching parameter/variable declarations, cancel_all() and put_event() placement, early-return on not am.inited, and adequate load_bar warmup depth.
A quant has finished backtesting a momentum strategy in Vibe-Trading and wants to run it live in vnpy. The skill reads the run's config and signal engine, then emits a ready-to-load CtaTemplate .py file with all parameters and indicators correctly wired.
A user describes a dual-MA crossover strategy for CSI 300 futures in plain language. The skill writes a complete, compliant CtaTemplate subclass — including BarGenerator, ArrayManager indicator calls, and proper long/short order logic — without requiring an existing codebase.
After export, the generated file can be dropped into a vnpy project and run immediately with BacktestingEngine, using the provided boilerplate for setting commission, slippage, capital, and date range.
A strategy that uses a daily trend filter combined with 5-minute entries is exported with correctly structured nested BarGenerator callbacks and separate ArrayManager instances for each timeframe.
config.json and code/signal_engine.py) or a plain-language strategy description — at least one is required.npx clawhub@latest install vnpy-exportLog in to write a review
No reviews yet. Be the first to share your experience!