This Python example describes a daily gold futures strategy using a short and a long Hull moving average (HMA). It opens a long position when the short HMA crosses above the long HMA and price is above the long average; the short signal crossing below is…
Βιβλιοθήκη γνώσης
Συνόψεις και κύριες ιδέες από βιβλία, μελέτες, άρθρα και κώδικα που διαβάζουν οι AI agents μας, γραμμένες από τον ερευνητικό agent της Stratmill. Κάθε σελίδα παραπέμπει στο πρωτότυπο.
Αναζήτηση στη βιβλιοθήκη
86 έγγραφα
This page is an index of complete strategy examples intended as starting points for adaptation in TqSdk. It groups examples into classic strategies, trend approaches, arbitrage, mean reversion, and algorithmic execution. Named examples include dual moving…
This example describes a futures grid strategy centered on a chosen starting price. It creates a fixed number of price levels on both sides, with each successive level set a constant percentage lower for the long side or higher for the short side. The target…
This reference describes how to retrieve account balances, positions, orders, and trades through TqSdk, and how those returned objects update as the API processes market and account events. It distinguishes futures-style objects from stock-style objects and…
The visible code describes a market-data backtesting component for the TqApi framework. Its documentation explains how simulated quotes are produced from subscribed data: tick subscriptions provide more frequent quote updates, while bar subscriptions can…
This documentation explains how to search strategy parameters by running repeated backtests with different values. Its example varies the short lookback in a two moving average crossover strategy, creates a fresh simulated account for each run, and prints…
This reference explains commonly used fields in market data objects and in futures and stock trading objects. For quotes, K-lines, and ticks, it identifies prices, timestamps, volume, open interest, and other session or contract details. Separate tables…
This code builds a synthetic steel mill profit spread from daily futures prices for rebar, iron ore, and coke. It calculates the spread as rebar minus weighted quantities of the two inputs, smooths it with a 15-day moving average, and estimates a standard…
This example builds a daily direction classifier for a rubber futures contract. Near a scheduled end-of-day cutoff, it uses recent closing prices to calculate three technical features, aligns each historical feature row with the following session's…
This code example implements an intraday R-Breaker strategy for a futures contract. It calculates seven reference levels from the previous daily bar: a pivot, breakout thresholds, setup levels, and reversal entry levels. When flat, price crossing a breakout…
This documentation explains how to manage a TargetPosTask instance in a futures trading application, focusing on cancelling a task and checking when it has finished. It states that an account may have only one such instance per contract at a time, and that…
This beginner-level example describes a daily-bar futures strategy that combines two moving averages with the close’s position inside recent candle ranges. It opens a long position when price is above both averages and the prior two candles show a shift from…
This guide compares TqSdk with direct development against the CTP interface, focusing on architecture, market data, and program flow. CTP connects directly to a futures broker’s trading system and uses event callbacks. TqSdk instead connects through…
This code example implements an intraday R-Breaker strategy for a futures contract while allowing positions to remain open overnight. It calculates a pivot and six reference levels from the prior daily bar: breakout thresholds, observation levels, and…