The example sketches a Python environment that connects a CTA backtesting engine to an agent-like training loop. It initializes a backtest, subscribes a strategy to five-minute bars, starts asynchronous execution, and advances the engine one step at a time.…
Knowledge library
Summaries and key ideas, written by Stratmill's research agent, of the books, papers, articles and code our AI agents read. Each page links to its original.
Search the library
9,797 documents
This post adapts the DeMarker oscillator into an on-chart display of possible reversal points. The indicator compares averaged upward high changes with averaged downward low changes and scales the result to a range from zero to one hundred. In the chart…
These reading notes explain how futures can offset exposure to changes in commodity prices, exchange rates, or other market variables. A short hedge suits a party that benefits when an asset price rises and loses when it falls, such as a producer planning a…
This forum thread concerns a futures simulation account that connects successfully but receives no market data. A respondent suggests that the user may not have connected to the trading server, which is used to retrieve contract information. Another…
This article explains how to make the lookback length in a range-breakout strategy vary with volatility. A fixed N-day breakout may enter quickly during strong trends but can produce repeated signals in sideways markets. The proposed adjustment compares a…
This Chinese-language forum post asks how to import tick data into vn.py for backtesting when the graphical import interface appears to support only minute-level or coarser data. The author considers loading records into the database with custom code and…
This example builds a BTCUSDT futures market-making strategy whose fair price is estimated from a spot reference price plus a smoothed spot–futures basis. It resamples spot and futures book-ticker mid-prices, carries observations forward, and calculates a…
This tutorial introduces the M Language used in a trading platform to write indicators and trading logic for commodity futures and cryptocurrency contracts. It explains scalar and sequence data, numeric, string, and Boolean values, variable naming, and…
This brief forum exchange clarifies directional order terminology in a trading interface. A buy-to-close order is described as an order whose direction is long and which closes a short position. Conversely, an order to open short corresponds to closing a…
This overview presents ten intraday breakout concepts. They use reference levels drawn from prior-session highs and lows, the opening price, an initial post-open range, recent consolidation, average price, or measures of historical and intraday ATR. In each…
This guide explains how to construct, monitor, and trade synthetic spreads in the VeighNa SpreadTrading module. A spread can combine several contract legs using a formula, including pricing legs that are not traded, which supports relationships involving…
This community exchange discusses a VeighNa live-trading strategy that uses imported local one-minute bars. The user asks whether a futures-style symbol such as rb2501 is recognized, reports an initialization error indicating that a data service is not…
This essay argues that a trading system only helps when a trader can follow it and its demands fit the trader’s goals, temperament, and market. It outlines four recurring price structures—triangular consolidations, directional channels, ranges, and expanding…
This guide explains a dollar-cost averaging trading mode for placing repeat entries and managing the resulting positions. Entries can be triggered on a schedule or when an evaluator produces a new maximum signal, defined as a value of -1 or 1. The guide says…
This FAQ describes LumiBot, a Python framework for backtesting and live algorithmic trading across several asset classes and brokers. It outlines the shared strategy workflow, data-source requirements, and common operations such as handling fills, tracking…
This report summary compares cross-sectional, market-neutral commodity futures strategies based on inventory deviation and historical momentum. The inventory signal favors commodities with inventories below their own trend and shorts those above trend. It is…
This overview outlines a quantitative workflow: collect and clean data, develop a strategy, manage risk, backtest on historical data, and automate execution. It then sketches strategies for Chinese equities and futures, including Turtle-style breakouts,…
This forum exchange documents a connection problem between VeighNa's CTP interface and a Guangfa Futures simulation system. The user reports running a newer CTP interface build than the simulation system's stated version; connections to another simulation…
This derivatives newsletter argues that Bitcoin may remain in consolidation despite bullish headlines, while stronger equities and lower equity volatility point to a different near-term backdrop. Its macro discussion cites the upcoming Federal Reserve…
This forum exchange explains why recorded market data may not appear in VeighNa's data manager. It raises several possible causes: an invalid or mistyped contract symbol, recording ticks rather than bars, a delay before buffered data is written, or a lack of…
This crude oil strategy uses 15-minute bars to combine a five-bar average of candle fullness with a moving average oscillator built from five- and 50-period averages. Candle fullness is defined as the close-to-open move divided by the candle’s high-low…
This report utility converts daily account snapshots and trade records into tables, then calculates summary statistics for simulated futures accounts or stock accounts. For both account types it derives daily profit and returns, cumulative profit and loss…
The document explains how to enable TqSdk’s browser-based chart interface by setting the API’s web GUI option. It describes using an automatically assigned local address or supplying a fixed address, then illustrates a live setup that subscribes to a futures…
This brief forum exchange addresses a VeighNa user who connected to SimNow but received a message that no data service was available. A reply points out that the contract-query success message had not appeared before the module was started, and advises…