Your strategies
Write a strategy in any language, keep it on the strategies page, run it in the backtest panel and through the agent, and allow each version of its code before it runs.
A strategy is code you write that works out lines from a listing's bars, and rules over those lines that Solyx's engine trades on. The code can be in any language your computer runs. The engine fills, prices and costs every trade, as it does for a template, so a strategy is measured exactly as a template is.
Strategies live in strategies/ in the config folder, one folder each. Solyx reads them afresh every time, so an edit shows the next time you look.
The strategies page
Strategies, under the symbol search in the left column, lists every strategy you wrote: what it buys and sells on, the numbers it takes, whether its version may run here and why not, and the last backtest the panel kept of it. From there you backtest one on a listing you hold, watch or type, which opens that listing's backtest panel with it, or have the agent write or change one. It also names the folders in strategies/ that don't read as a strategy, with the reason, and what a strategy's code finds to run on where it runs.
A strategy's own page adds its files, the versions you allowed, every run the panel kept of it on any listing, and buttons to allow its version, take back every version, open its folder or move it to the Trash, which takes back its versions too, so one put back asks again. Trade on its signals drafts a request for the agent to set up a scheduled task that trades on it. A paired browser reads both pages and runs backtests; the rest stays with the computer. The agent never deletes a strategy.
Writing one
STRATEGY.md opens with frontmatter that says what the strategy is, and may go on with notes for you and the agent:
---
name: atr-breakout
description: Buys a close above the last highs plus k average ranges, sells one under the average
run: python3 strategy.py
params:
period: { min: 10, max: 60, step: 5, initial: 20 }
k: { min: 0.5, max: 3, step: 0.5, initial: 1.5 }
rules:
entry:
crossesAbove: [{ line: close }, { line: upper }]
exit:
below: [{ line: close }, { line: trend }]
stopLoss: 0.08
---
What the idea is, when it works and where it fails.name: the folder's name, up to 64 lowercase letters, digits and single hyphens.description: what it does, in a sentence.run: the command that runs the code, in the strategy's folder.params: up to 8 numbers the code takes, each frommintomaxin steps ofstep, starting frominitial.rules:entryandexit, written as the agent'sbacktest.rulestakes them, withstopLossandtakeProfitif you like.{ line: name }reads a line the code works out.
A rule compares one of the strategy's lines only with another of its lines or with a value. The code works on prices adjusted for splits and what went ex on the first bar's terms, while a bar's own prices are as traded, so the two would part at every split. To compare with the close, give the close as a line of its own.
Writing one with the agent
Ask the agent for a strategy in words, or start from the strategies page's Write one with the agent, or from the backtest panel: the same button under My strategies while you have none, or Keep as my strategy beside a run of a template or written rules. The /strategy skill has the agent:
- settle the idea and the range of each number with you before it reads any result;
- check what the code can run on where it would run: the interpreters on the
PATH, and which of numpy, pandas, polars, scipy and TA-Lib its Python has; - write the folder, then check the lines its code works out, against the app's own indicators where it has the same one, and fix any line the look-ahead check names before any backtest;
- test it as
/backtestdoes, and say how many versions it saved and tested, since every version tried on the same bars uses up their out-of-sample stretch.
Allowing the agent's save allows the version it makes, so its card shows that version's files beside the version you allowed before, or every file of a new one. In a conversation set to Allow for me, a new strategy, or one the conversation wrote itself and nobody changed since, is saved unasked once the decisions model judges its code harmless; a change to a strategy you wrote always asks, and beside a live account outside the sandbox only you allow a version. The agent writes only text files inside the strategy's folder, never into what tools keep beside the code, and its save is refused where the files changed since it read them.
What the code reads and writes
The code reads JSON from the file $SOLYX_STRATEGY_INPUT names and writes JSON to the file $SOLYX_STRATEGY_OUTPUT names.
The input holds the listing, its bars as columns, and the jobs, each a set of numbers over the first so many bars. A bar's time is its session's date, or for bars shorter than a day its minute on the exchange's clock, as 2026-10-26 09:01.
{
"symbol": { "market": "TW", "symbol": "2330" },
"interval": "1d",
"bars": {
"time": ["2016-10-26", "…"],
"open": [],
"high": [],
"low": [],
"close": [],
"volume": []
},
"jobs": [{ "id": "run0", "params": { "period": 20, "k": 1.5 }, "bars": 2529 }]
}The output holds each job's lines by its id, one value a bar, null where a line has nothing yet. A NaN, as Python's json writes it, reads as no value too. The strategy above, in Python with run: python3 strategy.py or in Node with run: node strategy.mjs:
import json, os
data = json.load(open(os.environ["SOLYX_STRATEGY_INPUT"]))
output = {}
for job in data["jobs"]:
n, k = int(job["params"]["period"]), job["params"]["k"]
high = data["bars"]["high"][: job["bars"]]
low = data["bars"]["low"][: job["bars"]]
close = data["bars"]["close"][: job["bars"]]
upper, trend = [], []
for i in range(len(close)):
if i < 2 * n:
upper.append(None)
trend.append(None)
continue
ranges = [high[j] - low[j] for j in range(i - n, i)]
upper.append(max(high[i - n : i]) + k * sum(ranges) / n)
trend.append(sum(close[i - 2 * n + 1 : i + 1]) / (2 * n))
output[job["id"]] = {"close": close, "upper": upper, "trend": trend}
json.dump(output, open(os.environ["SOLYX_STRATEGY_OUTPUT"], "w"))A scan hands the code every set of numbers in one run, so work each job out on its own and write them all.
Where the code runs
A run copies the strategy's files into a folder of its own and runs the copy, so what runs is the version that was allowed, whatever the folder holds by then. It has 2 minutes for all its jobs.
- In the sandbox, on macOS and Linux while Settings → Code execution → Sandbox is on, which it is unless you turn it off: the code reads and writes only its run's folder, reads the tools on your
PATH, and reaches no network, not even your own computer. Keep the packages your code needs in an environment on yourPATH, such as a venv or uv's, since the sandbox hides the rest of your home folder. - Outside it, on Windows or with the sandbox off: the code runs with your access to your files and the network.
A strategy's folder may hold up to 1,000 files and 32 MB, and no links, since what a link points to could change while the version stays.
Allowing a version
A version is what the strategy's files hold: any change to any file is another version, and each runs only once allowed. The strategy's page, and Backtest under a listing's chart, show a version not yet allowed with Read what changed, which shows each file's lines added and removed since the version allowed before, and Allow this version. A paired browser leaves allowing to the computer.
When the agent runs a version not yet allowed, its call asks you first and its card shows the same changes. In a conversation set to Allow for me, the decisions model judges the code: a version runs unasked only when every risk it scores is unlikely, that the code touches files outside its own, reaches the network, reads secrets or starts other programs.
Beside a live account, a strategy's code outside the sandbox runs only on a version you allowed yourself: neither the decisions model nor Don't ask allows one there. Approvals are sealed with your keys, so no edit of the app's files allows a version.
The code is yours, and so is how healthy it is: Solyx keeps it to the sandbox where it can and checks what it can, but it does not read your code for bugs.
The look-ahead check
A rule is read at a bar's close and acted on at the next bar's open, so a line must come from its bar and the ones before it. Your code is handed every bar at once, so Solyx checks: it runs the first set of numbers again over the first fifth, two fifths, three and four of the bars, and compares each line with the whole run's.
Where a line differs, the code read later bars for it, as shift(-1), a centred window or the whole span's mean would. The run leads with a warning that names the line and the first bar, since every figure then rests on prices it could not have known. It is a warning, not a refusal.
Running one
- In the panel: Strategy → My strategies, then the strategy, then its numbers. A scan or a walk forward runs a grid along two of its numbers. Backtesting.
- Through the agent: the agent's scripts run a strategy with
strategies.backtest,strategies.scan,strategies.walkForwardandstrategies.rolling, as the panel does, andstrategies.signalsays whether its entry or exit holds at the newest bar's close, beside the position a backtest of the same bars holds there. - Trading on one: a scheduled task can read a strategy's signal after each session and have the agent propose the order. It is still a proposal: you confirm it, or your trading mandate sends it.