Skip to content
QuantWright

Describing a strategy

A backtest can only test the rules it is given. The more of them you state, the fewer the AI has to choose for you.


What a complete description covers

Market and bar size

The symbol and the bar size, for example “AAPL on 15-minute bars”. See Market data for what runs.

Entry

The exact condition, and the direction: long, short, or both.

Exit

What closes the trade: an opposite signal, a number of bars, a time of day, or the stop and target.

Stop and target

How each is measured: a percent from entry, a multiple of ATR, or a price level such as the prior swing low.

Position size

A share of equity (“30% of equity per trade”), a fixed number of units, or a risk per trade. The engine buys whole shares, ounces and units of currency (a coin is held in fractions), and every run starts with the account size you stated, or $100,000.

Session and timezone

For intraday rules, the hours and the timezone: “enter only between 10:00 and 15:00 New York time, flat by 15:55”. US stock intraday bars cover the regular session, 09:30 to 16:00 New York time.

Costs

Commission and slippage, as a percent or in basis points. See Costs.

A strategy someone else teaches

If you name a published strategy (a YouTuber’s setup, a course, a prop firm’s rules), the assistant can search the public web for how it is described (beta) and lists the pages it used under its reply, each a link marked with what kind of page it is: an author’s or firm’s own site, told by its address carrying a name you typed; a third-party page, such as a summary, review or article by someone else; a video page, whose address does not show whose channel it is; a forum, code repository or social post, where anyone can publish. The search queries, and the address of any page it opens (including a link you paste), go to the AI provider that runs the assistant, named in the Privacy Policy. What it finds can be wrong, out of date or someone else’s reading of the strategy, so check the sources, and state the rules you want tested in your own words.

Good and vague

VagueTrade QQQ when it’s oversold and take profits quickly.

“Oversold”, “quickly”, the bar size and the position size all have to be invented before this can be tested, and a different choice gives a different result.

SpecificQQQ on 1-hour bars, long only. Enter at the close of a bar when RSI(14) is below 30 and the close is above the 200-period simple moving average. Exit when RSI(14) crosses above 55, or at a stop 2% below the entry price. Put 30% of equity into each trade.

VagueA breakout strategy on Apple.

SpecificAAPL on 15-minute bars, long only. Enter when a bar closes above the highest high of the previous 20 bars, only between 10:00 and 15:00 New York time. Exit when a bar closes below the lowest low of the previous 10 bars, or at a stop 1.5 × ATR(14) below entry, and close any open position at 15:55. Put 30% of equity into each trade. Commission 0.01% per round trip.

Numbers the AI had to choose: /params go

A description sets rules; it rarely sets every number those rules need. “A strong candle” or “a pullback” needs a threshold before code can test it. The rules you state go into the code as you wrote them. A number the AI has to invent is a choice, and two runs of the same description can choose differently and get different results.

So when the AI had to choose a number, the run stops at a confirmation card first. The card lists each chosen value and why it was chosen, with a box to change it. Everything you did specify is already in the code and is not listed. Nothing is backtested until you run it, with the card’s button or with a command:

  • /params go runs with the values shown.
  • /params rsi_period=10 changes a value (use the names on the card) and runs.
  • /params strike key takes back something that was recorded from your message, so it is not applied.

When every value on the card was read from your words, the run does not wait: the card just shows them.

Exact mode: pin a strategy down

Words can be read more than one way. “Buy on the cross” can mean at that bar’s close or at the next open; “risk 2% a trade” may or may not stop at what the account can pay for. A normal run makes one reading and lists its choices on the result. Exact mode has the AI write your strategy three separate times from the same words, runs all three on the same bars, and compares the trades they made.

Where the three versions traded differently, the round card asks you a question for each difference, shows the code each version wrote, and offers a button for each answer (or type your own rule). Your answer is added to your description and wins over anything it conflicts with. The next round writes three new versions from the longer description. When all three make exactly the same trades, the strategy is pinned: that code is the result, and while Exact mode is on, sending the same description again re-runs it instead of writing new code. When a version’s entry orders were cancelled because the account could not pay for them, the card shows how many: a sizing choice can leave most entries unfilled, and that is worth knowing before you answer.

  • Start it with the Exact mode switch under the message box and then describe the strategy, with /exact followed by your description, or with Make it exact under a result.
  • Start round 1 on the card runs a round (/exact go); after answering, Re-check runs the next one.
  • /exact pin accepts the most common version, with the differences stated on the result. /exact stop ends the session without a result.

What it costs. Measured on an ETF strategy on daily bars, one round used about as much AI allowance as one normal backtest of the same description, about 1% of the daily allowance. A session runs at most 5 rounds; the one measured was pinned after 2. The round card says what a round costs before you start it. See what uses the AI allowance.

When to use it. When the exact rules matter more than speed: before you rely on a result, take it to a prop-firm check, or export it to another platform. For a first look at an idea, a normal run is quicker, and usually cheaper.

What it cannot do.

  • Agreement means the three versions made the same trades on these bars. It says nothing about whether the strategy is any good, and it is not a test on new data.
  • Three versions can agree on something you never said. Before a pin, the agreed code is checked against your words and a rule it does not follow is put to you; values every version chose on its own are listed on the card. Read both.
  • After 5 rounds there is no next round: you can pin the most common version or stop. Even a complete description does not always converge.
  • It needs a description of at least 12 words, and a time window needs its clock times and time zone (“10:00 to 11:00 New York time”).

Position size and the account

A backtest starts with the account size you state (“my account is 25,000 dollars”), or $100,000 when you state none, and the result says which. A re-run of a version keeps that version’s account, as it keeps its costs.

The engine trades whole shares, whole ounces of gold and silver, and whole units of currency. Crypto is the exception: a coin is held in fractions, to one hundred-millionth. A share of equity is turned into the whole units, or the fraction of a coin, it can buy. An order too small to buy one unit of anything but a coin is declined, and a run with no trades for that reason says so instead of reporting a strategy that never signalled.

Costs

State costs as a percent or in basis points, for example “commission 0.05% per round trip, slippage 0.02% per side”. Commission is read as a round trip unless you say it is per side, in which case it is doubled. Slippage is per side and is charged on entry and on exit. When you state nothing, these defaults apply:

MarketCommission (round trip)Slippage (per side)
US stocks and ETFs0.5 bp1 bp on daily bars, 2 bp intraday
Spot crypto20 bp5 bp
Spot FX0.2 bp0.5 bp on daily bars, 1 bp intraday
Spot gold0 bp1 bp
Spot silver0 bp4 bp

1 bp (basis point) is 0.01% of the value traded. Market data says how to state a commission per share, a spread per ounce or in pips.

Changing a strategy

After a result, say what to change: “tighten the stop to 1.5%”, “only trade on Tuesdays”. Each change runs as a new version, and later commands act on the newest one.

To move a number without asking the AI, use /tweak name=value. It re-runs the last strategy with the new value, and the AI does not rewrite anything.

Not answered here? Write to us through the Support page.

Describing a strategy — QuantWright Help