Skip to content

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.

Quant Q&A
20,364 documents
SuperMind
12,226 documents
OKX Learn
8,431 documents
Strategy library
7,910 documents
MQL5 code base
7,090 documents
BigQuant
3,481 documents
Bitget Academy
3,298 documents
MQL5 articles
3,012 documents
TradingView scripts
1,976 documents
ProRealCode
1,507 documents
Deribit Insights
1,232 documents
Machine Learning for Trading
1,124 documents
arXiv papers
1,033 documents
Amberdata research
766 documents
FMZ forum
682 documents
FMZ digest
662 documents
vn.py community
560 documents
QuantInsti blog
511 documents
Galaxy Research
340 documents
QuantStart
246 documents
Stratmill research code
219 documents
Robot Wealth
195 documents
NautilusTrader
191 documents
Hummingbot docs
181 documents
Paradigm research
175 documents
Lumibot
164 documents
Kraken Learn
163 documents
Quant course library
157 documents
OctoBot
152 documents
Cryptohopper blog
144 documents
Systematic trading blog (Rob Carver)
132 documents
Qlib
116 documents
Quantpedia
86 documents
TqSdk
86 documents
Hyperliquid docs
79 documents
Freqtrade
68 documents
Hudson & Thames
62 documents
Awesome Systematic Trading
61 documents
backtrader
54 documents
vn.py
50 documents
Quantopian lectures
45 documents
Binance API docs
45 documents
FMZ guides
38 documents
pysystemtrade
34 documents
Freqtrade docs
32 documents
quant-trading
31 documents
FinRL
28 documents
Zipline
22 documents
FMZ live strategies
21 documents
Jesse
17 documents
pyfolio
16 documents
Alphalens
14 documents
WonderTrader
14 documents
backtesting.py
11 documents
Technical Analysis
9 documents
QTPyLib
8 documents
QuantRocket
7 documents
Lumibot strategies
7 documents
Awesome Quant
1 documents

Search the library

86 documents

TqSdk

This tutorial explains the true range (TR) and average true range (ATR), then shows how to calculate and display both for a Shanghai Futures Exchange gold contract using TqSdk. True range takes the largest of the current high-low range, the gap between the…

FuturesTechnical indicatorsVolatility
TqSdk

This reference describes a Python toolkit for calculating technical indicators and analyzing trading returns on pandas time series. Its functions cover lagged values, rolling standard deviation and simple averages, exponentially or linearly weighted…

Technical indicatorsStatisticsBacktesting
TqSdk

The document shows how to send a phone notification through a DingTalk custom robot when a TqSdk strategy starts or a market condition is met. Its example watches a futures quote, checks whether the last price crosses a threshold, sends a text alert, and…

FuturesExecution
TqSdk

This asynchronous example implements a futures grid around a chosen starting price. It creates multiple long and short trigger levels using repeated percentage steps, assigns a trade size to each level, and starts a watcher task for every grid interval. A…

FuturesGrid tradingExecutionRisk management
TqSdk

This operational note describes using an internet-connected smart plug as an emergency way to stop an unattended trading system when remote login, network access, or the program itself has failed. One setup powers the strategy computer through the plug,…

ExecutionRisk management
TqSdk

This script describes a three-leg futures strategy that treats hog value minus weighted corn and soybean meal costs as a proxy for livestock feeding profitability. It estimates the spread’s mean and standard deviation from daily bars, calculates a z-score,…

FuturesCommoditiesMean reversionArbitrage
TqSdk

The script demonstrates a calendar spread strategy for two nearby equity index futures contracts. It calculates the spread between their closing prices over a rolling window, estimates the mean and standard deviation, and sets upper and lower thresholds two…

FuturesPairs tradingMean reversionBacktesting
TqSdk

The script describes a mean-reversion strategy that trades a spread between two steel futures contracts. It collects daily closes, standardizes each contract’s recent prices over a rolling window, and subtracts the standardized series to form a spread. A…

FuturesMean reversionPairs tradingBacktesting
TqSdk

This example presents a basic futures strategy using daily Bollinger Bands. It calculates the 26-period bands with a parameter of 2, enters long when the latest price rises above the upper band, and enters short when it falls below the lower band. The target…

FuturesBreakoutTechnical indicatorsPosition sizing
TqSdk

This reference explains how TqSdk represents option contracts and exchange-defined combinations across several Chinese futures and securities venues. It gives examples of contract-code formats for calls and puts, ETF and index options, and calendar spread…

OptionsDerivatives pricingVolatilityExecution
TqSdk

This example schedules a target futures position across a chosen intraday window according to the historical distribution of volume. It groups past bars by trading day and time, computes each time slot's share of that day's session volume, averages those…

FuturesExecutionMarket microstructureStatistics
TqSdk

This futures example computes daily pivot, support, and resistance levels from the prior session's high, low, and close. It trades a copper contract by entering long when price falls below first support or short when it rises above first resistance.…

FuturesTechnical indicatorsMean reversionRisk management
TqSdk

The document explains how to retrieve futures margin rates through TqSdk2 when a trading program otherwise uses TqSdk. It describes running both libraries in one Python file: connect directly to a CTP broker through TqSdk2, query the margin rate for a…

FuturesRisk managementExecution
TqSdk

This guide explains how to use TargetPosTask to move a contract’s net position toward a requested target. Create one task per contract, set a positive, negative, or zero target for long, short, or flat exposure, and keep calling the update loop so the task…

FuturesExecutionPosition sizingMarket microstructure
TqSdk

This futures strategy tracks the ratio of copper to aluminum contract values, adjusting each contract’s daily close by its volume multiplier. It calculates the historical mean and standard deviation of that ratio, then uses the current ratio’s z-score to…

FuturesCommoditiesPairs tradingMean reversion
TqSdk

This example describes a three-leg futures strategy that treats polyester fiber value minus the weighted costs of PTA and ethylene glycol as a production margin. It estimates the margin’s mean and standard deviation from recent daily bars, then calculates a…

FuturesCommoditiesMean reversionBacktesting
TqSdk

This guide walks through a TqSdk workflow, from setting up an account and connecting to live quotes to reading synchronized bars, checking account and position references, and submitting or cancelling orders. Its central pattern is to create an API, request…

FuturesTechnical indicatorsBacktestingExecution
TqSdk

This stock-selection idea combines a technical condition, an industry filter, and recent positive returns. It proposes screening for Chinese beverage and alcohol import-export companies with a 14-period RSI below 65 and a positive return, while also…

EquitiesChina marketsTechnical indicatorsStatistics
TqSdk

The document examines whether volatility in the CSI 300 varies by weekday and time of day, then uses that pattern to modify Black–Scholes pricing for an index option. It calculates five-minute log returns from open to close over a year of index data,…

OptionsVolatilityDerivatives pricingStatistics
TqSdk

The document explains how to run tested trading programs without continuous supervision using the TqSdk environment. It covers prerequisites, configuring a live futures account, writing logs to files, closing the API cleanly, and avoiding broad exception…

FuturesExecutionRisk management
TqSdk

This Chinese-corn-futures example combines the Chande Momentum Oscillator (CMO) with a short moving average to generate long and short entries. Signals include reversals from overbought or oversold levels, CMO crossings of its signal line, and zero-line…

FuturesCommoditiesMomentumTechnical indicators
TqSdk

This guide explains how to use a target-position scheduler to execute a sequence of position-adjustment tasks. A table specifies each task’s duration, desired net position, and pricing mode: pause, passive quote, active quote, or a custom price function.…

FuturesExecutionMarket microstructure
TqSdk

This example describes a short-term price timing strategy for a gold futures contract. It calculates an AR indicator from recent daily bars by comparing the accumulated distance from open to high with the distance from open to low, scaled as a percentage.…

FuturesCommoditiesMomentumTechnical indicators
TqSdk

This Python module documents functions for calculating common technical indicators from market bars and options data. The visible functions include average true range, bias, Bollinger Bands, directional movement, KDJ, MACD, parabolic SAR, and Williams %R.…

Technical indicatorsFuturesOptionsVolatility