The document explains how TqSdk’s wait_update loop drives data subscriptions, background tasks, and trading requests. Call get_* methods once and keep their returned objects as live references; subsequent update calls refresh them. Use is_changing to respond…
Бібліотека знань
Огляди й ключові ідеї книжок, наукових праць, статей і коду, які читають наші ШІ-агенти. Їх підготував дослідницький агент Stratmill. На кожній сторінці є посилання на оригінал.
Пошук у бібліотеці
Документів: 86
This guide explains how to split one live futures account into multiple locally managed strategy accounts with TqSdk. Each strategy account keeps its trading data separate across sessions, allowing positions, orders, funds, and profit and loss to be viewed…
The script describes a daily gold-futures strategy using the Commodity Channel Index (CCI) with a 10-period lookback and thresholds at 100 and -100. It enters long when CCI moves back from below the lower threshold into the middle zone, and enters short when…
This tutorial explains two ways to run a strategy across multiple instruments with different parameters, using a dual moving-average crossover as its example. One approach launches a separate process for each instance, passing the symbol and moving-average…
This documentation page introduces two example execution algorithms: TWAP, which distributes trading over time, and VWAP, which weights execution according to trading volume. It assumes readers already understand target-position tasks, order placement and…
This reference compares direct order placement, cancellation, target-position control, scheduled execution, and TWAP tools for futures and stock workflows. Manual orders suit cases requiring explicit price selection, cancellation decisions, partial-fill…
This example describes a daily futures strategy using the Vortex Indicator to identify directional crossovers. It calculates positive and negative vortex movement relative to rolling true range, then opens a long position when the positive line crosses above…
This strategy applies a moving average of the difference between daily closes and opens as a Qstick signal on a China-listed equity index futures contract. It enters long when Qstick crosses above zero and price is above its simple moving average, and enters…
The document describes using TqSdk from Jupyter Notebook for market analysis and research. It highlights the notebook’s interactive workflow, where code can be run incrementally, and its ability to display charts alongside analysis. It points readers to…
This futures strategy tracks the crush spread formed from soybean, soybean meal, and soybean oil contracts. It weights the three contract prices using an approximate processing ratio, computes the spread as the combined meal and oil value less the soybean…
This reference explains how TqSdk identifies contracts across Chinese exchanges and describes available quote, K-line, and tick data. It gives examples of futures, options, spread contracts, continuous contracts, indices, stocks, and exchange warehouse…
This practical article discusses market data reliability as an operational concern for high-frequency foreign exchange systems. It describes failure modes such as delayed quotes, dropped connections, and anomalous prices, which can interfere with short-term…
This example implements a daily futures strategy around triple-smoothed exponential moving averages. It calculates TRIX and a rolling signal line, then enters long when TRIX crosses above the signal or short when it crosses below. The position is set to a…
This terminal guide explains how to launch, stop, review, and rerun a strategy backtest. It describes the evolving strategy report, logs, and trade chart, including how fills, positions, working orders, and log timestamps are displayed. Saved runs can be…
This documentation describes two related tools for calculating technical signals from K-line data. The technical-indicator module provides named indicator functions that take a pandas DataFrame of bars and return a DataFrame of calculated series. MACD is…
TqScenario supports synchronous what-if calculations from a snapshot of futures positions and account equity. The document explains how to initialize that snapshot, simulate opening or closing orders, change a symbol’s margin rate, and inspect resulting…
This trading script implements a daily Keltner Channel strategy for a CFFEX index futures contract. It calculates an 8-period exponential moving average as the channel center and uses a 7-period average true range with a 1.5 multiplier to set the bands. A…
This example describes a mean-reversion strategy for two SHFE futures contracts. It uses a Kalman filter to update the hedge ratio between the instruments, calculates the resulting spread, and standardizes it against a rolling window to create a z-score. The…
This documentation page indexes a sequence of option-use examples for a trading SDK. The topics move from retrieving live option quotes and screening contracts to classifying options as in the money, at the money, or out of the money. Further examples cover…
This example strategy trades relative price relationships among soybean oil, rapeseed oil, and palm oil futures. It calculates a normalized spread index from the three daily closing prices, then compares five-period and fifteen-period moving averages. A…
This futures strategy uses a six-period RSI on daily bars to trade reversals in a single contract. It enters long after RSI has been below 35 and then crosses back above that level; it enters short after RSI has exceeded 65 and then falls below it. Positions…
This documentation explains the basic structure of a TqSdk trading program. A single TqApi instance manages the server connection, in-memory market and account data, trading commands, background coroutine tasks, and backtesting. The API can use live,…
This futures execution example sizes each order as a configurable fraction of visible top-of-book volume, capped by the remaining target quantity. It selects either the opposing quote or same-side quote as the volume reference, then submits an order at the…
This example describes a daily gold futures strategy using a 10-bar Aroon calculation. It opens a fixed-size long position when Aroon Up crosses above Aroon Down or when Aroon Up is above 75 while Aroon Down is below 25. The short rules reverse those…