Products Language

Ideas that take a few words.

Ideas that take a few words in qkt: trade the gap between two markets, pick any candle size, stack trades from one signal. Each clip edits a real file and re-runs it.

Pairs and spreads

Two markets, two clocks, one rule.

Declare each symbol with its own candle size and compare them in one condition. This file watches the ratio of an altcoin to Bitcoin: when it stretches, it sells the rich leg and buys the cheap one, dollar for dollar.

The clip changes one thing at a time and runs it again: slow Bitcoin to 4-hour candles, swap the altcoin, then add a daily stream and a correlation check. Grey is the run before.

A pairs strategy on ETH and BTC is edited four times: the Bitcoin candle size, the altcoin, then a daily regime filter. After each edit it runs again and the equity curve is drawn over the previous one.

Real runs on Binance USD-M bars, 1 to 30 September 2026, mid-price fills and no costs. This is spread trading, not risk-free arbitrage: the legs can stay apart. Nothing here is a recommendation.

The same shape works on CFDs through the BACKTEST prefix, here gold against silver:

goldsilver.qkt
STRATEGY goldsilver VERSION 1
SYMBOLS
    gold   = BACKTEST:XAUUSD EVERY 15m
    silver = BACKTEST:XAGUSD EVERY 4h
RULES
    WHEN zscore(gold.close / silver.close, 50) >= 2
     AND POSITION.gold = 0
    THEN SELL gold SIZING 0.05 ; BUY silver SIZING 0.08

    WHEN POSITION.gold != 0
     AND abs(zscore(gold.close / silver.close, 50)) <= 0.5
    THEN CLOSE gold ; CLOSE silver
What it declares
gold
BACKTEST:XAUUSD · 15m
silver
BACKTEST:XAGUSD · 4h
Enter
ratio z-score ≥ 2 or ≤ −2
Exit
z-score back within 0.5

Parses on qkt 0.55.1. Shown without a result: balanced gold/silver legs lost money over the two months tested.

Two venues work the same way, one stream per venue. Whether that pays depends on fees, fills and latency, which is what a backtest with a realistic broker model is for.

Streams and timeframes Baskets as one leg

Any candle size

Not just 1m, 5m and 1h.

EVERY takes seconds, minutes, hours or days: 5s, 16s, 2m, 4m, 6h. The same rule runs on each, and a file can read several sizes of the same symbol at once, such as a fast entry that only fires while the 6-hour trend is up.

One RSI rule on BTCUSD is replayed from ticks with the candle size changed from 5 seconds to 16 seconds, 2 minutes, 4 minutes, 1 hour and 6 hours, then combined with a second 6-hour stream.

Real runs replayed from BTCUSD ticks, 8 to 15 September 2026, no costs. Counts range from 71 round trips to 3, so read them as an illustration of the clock, not as a ranking.

fade.qkt
STRATEGY fade VERSION 1
SYMBOLS
    btc  = BACKTEST:BTCUSD EVERY 16s
    slow = BACKTEST:BTCUSD EVERY 6h
RULES
    WHEN rsi(btc.close, 14) < 30
     AND POSITION.btc = 0
     AND slow.close > ema(slow.close, 5)
    THEN BUY btc SIZING 0.01
         BRACKET { STOP_LOSS BY 0.5 PCT, TAKE_PROFIT BY 0.5 PCT }
Two clocks, one symbol
Fast stream
BTCUSD · 16s
Slow stream
BTCUSD · 6h
Entry fires when
RSI < 30 and 6h trend up
Profit
+2.42 USD23 round trips

The 16-second RSI entry only fires while the 6-hour close is above its 5-bar average.

In a backtest, any window the data can build works. On a live MT5 feed a window has to be buildable from its M1 or H1 bars or from ticks, and qkt refuses at deploy, naming the window, when it cannot.

Supported windows

Stack and repeat

Many trades from one idea.

One signal can open one trade, add smaller trades as it works, or repeat the whole entry. Each leg has its own stop and target, so a stack hitting its target does not touch the first trade.

A gold entry with a stop and target is run on its own, then with a conditional extra leg added once it is four dollars in profit, then repeated three times. The third run is three times the size and has a much deeper drop.

Real runs on XAUUSD 15-minute bars, 1 October to 1 December 2025, no costs. Repeating an entry three times is three times the size and three times the risk, not extra edge: the worst drop grows with the profit.

layers.qkt
STRATEGY layers VERSION 1
SYMBOLS
    gold = BACKTEST:XAUUSD EVERY 15m
RULES
    WHEN gold.close CROSSES ABOVE ema(gold.close, 50)
     AND POSITION.gold = 0
    THEN BUY gold SIZING 0.1
         BRACKET { STOP_LOSS BY 8, TAKE_PROFIT BY 16 }
         STACK_AT MFE >= 4 WITHIN 30m SIZING 0.05
             BRACKET { STOP_LOSS BY 2, TAKE_PROFIT BY 12 }
The same entry, three ways
One entry
+1,472.03 USDworst drop 12.0%
+ STACK_AT
+891.51 USDworst drop 15.0%
TIMES 3
+4,416.08 USDworst drop 30.4%

More to try

Each of these is a few lines too.

  • Clock-driven actionsAct at 08:00 London or 14:30 New York, once, even when no tick lands in that second.
  • Order structuresOCO pairs, one-trigger-another orders and trip-wire entries are single clauses, not code you maintain.
  • Equity-aware rulesRead the account's own equity as a series inside a rule.
  • One file, every modeThe file that backtests is the file that paper-trades and runs live. The broker prefix on each stream says where it points.
The full reference

Write your first strategy today.

One command to install. Eight lines to a backtest. Free and open source.