Your strategy prompt can be as simple or complex as you want. Use plain English with dashes to define conditions — Vertex Street interprets the logic and builds the backtest for you.
A strategy is a set of rules describing when to buy and when to sell. Use dashes to list conditions:
From 2020-01-01 to 2025-01-01 (daily):
- Buy AAPL when RSI(14) < 30 and price is above the 200-day SMA
- Sell when RSI(14) > 70 or price drops 5% from entryStack as many conditions as you need. All conditions on a single buy/sell line must be true simultaneously:
From 2019-01-01 to 2025-01-01 (daily):
- Buy SPY when:
- RSI(14) < 30
- Price is above the 200-day SMA
- MACD histogram is positive
- Volume is 1.5x above the 50-day average
- Sell all when RSI(14) > 70You can trade multiple assets with different rules:
From 2018-01-01 to 2025-01-01 (daily):
- Buy AAPL when P/E ratio < 20 and revenue growth > 10%
- Buy MSFT when price crosses above the 50-day SMA
- Sell AAPL when P/E ratio > 35
- Sell MSFT when price crosses below the 50-day SMAUse "double down" or "add to position" to increase your stake without re-triggering the initial buy condition. This only fires if you already hold the asset:
From 2021-01-01 to 2025-01-01 (daily):
- Buy SPY when RSI(14) < 30 and price > 200-day SMA
- Double down on SPY if price drops another 5% from my last buy
- Sell all SPY when RSI(14) > 70The double down rule is independent — it won't open a new position, it only adds to one you already hold. You can chain multiple levels:
From 2022-01-01 to 2025-06-01 (daily):
- Buy QQQ when price drops 10% from 52-week high
- Double down if price drops another 5% from last entry
- Double down again if price drops another 5% from last entry
- Sell all when price recovers to the 50-day SMASpecify how much to invest per trade:
From 2020-06-01 to 2025-01-01 (daily):
- Buy $2,000 of NVDA when earnings growth > 25% and P/E < 40
- Buy 50% of available cash in TSLA when RSI < 25
- Sell half my NVDA when it's up 30% from entry
- Sell all TSLA when price breaks below 200-day SMAMix time and technical conditions:
From 2020-01-01 to 2025-01-01 (daily):
- Buy VTI on the first trading day of each month
- Sell all if the S&P 500 drops more than 3% in a single week
- Re-buy after 5 trading days if price is above the 20-day SMAAdd money to the portfolio on a schedule, or take it out. Deposits count as capital you paid in rather than as gains, so the return still reflects how the strategy performed. The schedule is just another condition, so the backtest keeps running on daily bars:
From 2020-01-01 to 2025-01-01 (daily):
- Add $1,000 to the portfolio on the last trading day of each month
- Buy $1,000 of VTI on the last trading day of each month
- Withdraw $2,000 at the end of every yearSee Portfolio Strategies for withdrawals from a fully-invested portfolio and what the summary reports.
Some questions aren't about a rule firing on a signal — they're about a kind of date. When does the price usually bottom out relative to a dividend? What happens either side of earnings? Ask for the timing around a set of dates and Vertex Street lines every one of them up on the same axis — trading day −10 through +10, where 0 is the event — and averages the path across all of them. You get one row per offset, plus the entry and exit that would have paid best across the whole sample.
The dates can come from a company's dividend history, its earnings announcements, or a list you type out yourself.
For Coca-Cola over the last 10 years, what's the best time to buy relative to its ex-dividend dates?The ex-dividend date is the one that matters — it's the day the price drops by roughly the dividend, and the last day you can buy and still be paid. Expect to see that drop in the table: it is mechanical, not a loss, because the money left the company and went to shareholders. Ask for total return if you want it netted back out.
How does NVDA typically trade in the two weeks before and after an earnings announcement? Use the last 8 years.Earnings reactions run longer than dividend ones, so a wider window is usually worth asking for. Name the window in trading days and it will be used as given.
Take SPY on 2024-01-16, 2024-06-11 and 2024-11-05. On average, when would the best time to buy have been around those three dates?Any list of dates works — Fed meetings, product launches, the days you actually bought. Three dates describe those three dates and nothing more, though: with a handful of events the "best" window is mostly luck, which is what the summary's event count and t-statistic are there to tell you.
The best entry and exit are found by testing every pair of days in the window against the same history they are then scored on. That makes the headline return a description of the past, not a rule that repeats — a wide enough search will always find something. Three numbers on the summary card tell you whether it means anything:
Dates that don't have a full window either side — an event too close to the start or end of the price history — are left out of the average rather than filled in, and the count of what was skipped is reported alongside.
From 2019-01-01 to 2025-01-01 (daily):
- Buy AMZN when:
- Revenue growth > 15%
- Free cash flow is positive
- RSI(14) < 40
- Price is within 10% of 52-week low
- Sell when P/E > 60 or price drops 15% from peak