Products Language
Reads like the idea in your head.
A strategy is one small file: the streams it reads, then rules that say when to act. This tour walks through a real one.
A real file
Pick a line. See what it does.
This is eur-paper.qkt from the production-stack example: a forex version of the same idea the get-started guide runs on Bitcoin. It parses and runs on the current release.
STRATEGY eur_paper VERSION 1
Strategy eur_paper, version 1
SYMBOLS
eur = MT5:EURUSD EVERY 5m
eur is EURUSD from the MT5 broker, on 5-minute bars
RULES
WHEN ema(eur.close, 9) CROSSES ABOVE ema(eur.close, 21)
When the 9-bar EMA crosses above the 21-bar EMA
AND POSITION.eur = 0
and we hold no eur,
THEN BUY eur SIZING 0.01
buy 0.01 lots of eur
BRACKET { STOP LOSS BY 30, TAKE PROFIT BY 60 } ; LOG "paper long entry" price=eur.close
with a stop 30 away and a target 60 away. Label it “paper long entry”.
WHEN ema(eur.close, 9) CROSSES BELOW ema(eur.close, 21)
When the 9-bar EMA crosses back below the 21-bar EMA
AND POSITION.eur > 0
and we hold eur,
THEN CLOSE eur ; LOG "paper exit" price=eur.close
close it. Label it “paper exit”.
Keep going
There is a lot more, and it is documented.
59 indicators, sizing by percent of equity or risk, brackets and trailing stops, multi-symbol rules and portfolios. Every example in the reference is compiled by qkt's own tests.
The full grammar Patterns: pairs, any candle size, stacked trades Example strategies to start fromWrite your first strategy today.
One command to install. Eight lines to a backtest. Free and open source.