This documentation explains how to run a TqSdk strategy over historical data without changing its core logic, and how to retrieve trade logs and account statistics when the simulation ends. It describes catching a backtest-finished event, accessing summary…
Perpustakaan pengetahuan
Ringkasan dan idea utama buku, kertas kajian, artikel serta kod yang dibaca oleh ejen AI kami, ditulis oleh ejen penyelidikan Stratmill. Setiap halaman memautkan sumber asal.
Cari dalam perpustakaan
86 dokumen
This reference explains advanced order instructions for futures and options trading through TqSDK. It compares ordinary limit orders, FAK orders that cancel any unfilled remainder, and FOK orders that cancel unless the full quantity can execute immediately.…
This TqSdk guide explains how to run timed actions inside the main loop driven by wait_update, rather than pausing the program with a separate sleep loop. For actions tied to the trading session, it recommends checking the market timestamp in quote.datetime,…
This code describes a mean-reversion strategy for the spread between Dalian Commodity Exchange coke and coking coal futures. It calculates a weighted value spread using contract prices, contract multipliers, and a specified leg ratio, then estimates the…
This comparison explains differences between TqSdk and vn.py that matter when adapting existing trading strategies. vn.py is presented as an integrated package with market data, trading connections, storage, and interface components. TqSdk instead uses…
This guide explains a replay mode for reviewing a trading strategy against historical market data for a chosen trading day. Unlike event-driven backtesting, replay is time-driven: the service streams the day’s historical data for subscribed contracts,…
This reference distinguishes local simulation accounts from remote Quick simulated accounts for futures and stocks. It describes TqSim as a local futures simulation option for development and backtests, TqKq as a Quick linked futures account, and…
The document argues that trading systems should be written so that changes to strategy logic require only localized code edits. It illustrates this with an R-Breaker example: if backtesting suggests that holding positions overnight adds risk without enough…
This example implements an intraday breakout strategy around the prior session’s high and low. It opens a long position when the latest price rises above the prior high and a short when it falls below the prior low, targeting a fixed position size in either…
This reference organizes common TqSdk problems by symptom and suggests likely causes and corrective checks. It covers empty or stale market data, queued order requests that have not been sent through an update cycle, target-position tasks that fail to act,…
This example describes a futures strategy using the Volume Price Trend (VPT) indicator on daily bars. It updates VPT by adding volume multiplied by the latest percentage price change, then compares the current value with a moving average. A trade is…
This beginner guide introduces Python syntax and core programming constructs that are useful when starting quantitative strategy research. It covers indentation, comments, assignment, imports, basic types and arithmetic, comparisons, and conditional logic.…
This documentation explains design choices behind TqSdk, a Python trading software development kit. It aims to avoid imposing a strategy model: users can fetch data and issue orders freely, while examples demonstrate possible applications instead of…
This example demonstrates an iceberg-style execution workflow for a futures contract. The trader chooses a symbol, a total volume, minimum and maximum order sizes, and a buy or sell direction. A target-position task manages orders toward the desired net…
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 framework overview explains TqSdk’s component layout and message flow. It describes TqChan as a one-way queue between components and outlines how order messages travel from user code through TqApi and TqAccount to a trading gateway. In the reverse…
The script describes a two-sided futures strategy on hourly bars. It identifies confirmed swing low and swing high fractals, then enters long when price breaks above a bullish fractal’s high during a short-over-long moving-average uptrend. It enters short…
The document explains a terminal feature that replays an entire historical trading day. A user chooses a date when launching the replay version of the terminal, then uses the software and its extensions as though operating during that session. Playback can…
This example implements a futures Turtle-style trend-following system. It enters long when price breaks above a prior Donchian channel high and short when price breaks below the channel low. Position size is based on account balance, contract multiplier, and…
The strategy models a refining spread using crude oil, fuel oil, and a third petroleum product in a 3:2:1 weighting. It calculates the spread as the weighted value of the two product legs minus the weighted crude leg, then compares the current spread with…
This example implements a daily mean-reversion strategy for a Shanghai Futures Exchange gold contract. It calculates a Z-score from recent closing prices, enters long when the score falls below a negative entry threshold and short when it rises above a…
This TqSdk reference explains how to authenticate with a platform account and select a live futures account, a shared platform simulation account, or a local simulation account when creating the API object. It describes live-account binding limits and common…
This reference explains common market-data workflows in the TqSdk Python interface. It covers subscribing to real-time quotes, monitoring updates to quote fields, and requesting K-line bars or tick series as data frames that update in place. It also…