The post asks whether two instances of the same VeighNa CTA strategy can mix state when assigned to different contracts. It points to `all_fractals`, a list declared in the strategy class body, and also shows `last_stop_loss_time` declared there. In Python,…
Biblioteca de cunoștințe
Rezumate și idei principale din cărțile, lucrările, articolele și codul citite de agenții noștri AI, redactate de agentul de cercetare Stratmill. Fiecare pagină trimite la sursa originală.
Caută în bibliotecă
560 documente
The forum exchange answers two practical questions about using vn.py for small retail stock investments and identifying its data sources. A reply says that vn.py offers support for the XTP trading interface, but access requires a third-party purchase. It…
A forum user asks how to import bond data for backtesting when signals may depend on yield to maturity, while trades use full price. The question also raises the handling of clean and full prices, tick data, and the difficulty of applying price adjustment…
This brief VeighNa forum exchange addresses why a date column may appear in cleaned data shown by the data manager but not in values printed from an ArrayManager. The reply distinguishes the two components by purpose: the data manager displays stored market…
A VeighNa community discussion addresses a futures strategy using one-hour bars, long moving averages, and calculations over a longer run of closing prices. The questioner reports that a simple moving average request above the default ArrayManager capacity…
A short forum exchange addresses why the final minute bar appears to be missing before the market close. The reply explains that VeighNa timestamps a bar at the time the candle begins. As a result, a bar covering the final minute may carry the timestamp for…
This forum thread discusses lightweight ways to connect Python applications to Chinese futures brokers through the CTP interface. One participant recommends using VeighNa’s CTP API wrapper directly when only market data and order entry are needed, without…
This Chinese community post presents a VeighNa CTA strategy built around Bollinger Bands and recent closing-price extremes. It aggregates incoming bars into daily bars, then updates an array manager and waits for its data window to initialize. A long entry…
The discussion considers whether a strategy handling frequent submissions and cancellations should manage orders through the framework’s event loop or use a separate thread. The proposed approach is event-driven: submit orders, track active order identifiers…
This short example demonstrates adding three technical-analysis series to closing-price data: a linear regression value over a 14-period window, a time-series forecast over the same window, and a standard deviation over five periods. It also shows plotting…
This note explains how Python evaluates `not callback` in a `load_bar` method. The expression tests whether the argument is false-like, rather than requiring it to be a Boolean. Since the default callback is `None`, the check selects the strategy’s `on_bar`…
A short forum exchange raises a reproducibility issue: the same options strategy reportedly produced different returns in two backtests. The original poster wonders whether running several strategies at the same time caused the discrepancy. A respondent…
This forum exchange documents a VeighNa user who could not find a DCE futures contract in the contract query or when submitting an order. The log shows the trading application starting, loading risk rules, attempting a CTP connection, and then reporting that…
This short VeighNa community exchange answers how to obtain the time associated with the current bar inside an on_bars callback. The reply takes the first bar from the supplied bars collection and reads its datetime field. This gives a direct way to inspect…
This short forum exchange explains one possible cause of a SimNow trading-server login failure that returns CTP error code 4 with an inactive-user message. A user asks why login is failing, and a respondent says the account may have been frozen after a long…
This forum exchange addresses duplicate or misaligned intraday bars in an options strategy. A user reports that live indicator signals occur at different times from backtest signals and observes repeated minute-bar pushes from an option bar generator. The…
This code describes a multi-contract futures strategy that combines daily contract selection with three-minute entry signals. It ranks instruments by trading activity relative to open interest and by daily range relative to the open, then permits new…
A forum discussion considers how to size orders dynamically during a backtest as account equity changes. The trader describes a strategy that may lose capital after a position closes and then needs to size a new entry using the reduced balance. They explain…
A trader asks whether a strategy’s on-trade callback can receive fills from orders placed outside the strategy, using a separate trading platform while the program is running. A forum response explains that the strategy callback receives execution reports…
The document raises a focused implementation question about building one-minute bars from tick data with VeighNa’s BarGenerator. It asks why the update logic compares the current bar high with a tick’s last traded price, then conditionally considers the…
This forum exchange explains a BarGenerator behavior for forming hourly candles when a contract is inactive near the end of an hour. If no new market data arrives during the final minutes, the incoming bar may carry a timestamp in the next hour. The hour…
This brief forum exchange concerns a user who cannot find an IM-prefixed futures contract in VNPY’s contract lookup and market-data records. The reply suggests checking whether the contract query has completed successfully before searching, since attempting…
A VeighNa community exchange discusses why a backtest may show a flat return curve when stock data contains negative prices after adjustment. One participant reports seeing negative values in forward-adjusted data for a stock and notes that crude oil futures…
The forum exchange describes a trading interface that connects successfully while its market data interface remains silent. The user reports that there are no errors or logs, making diagnosis difficult. A respondent recommends checking whether the market…