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…
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
6 documents
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…
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…
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,…
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.…
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…