
How to Forward Test a Strategy
Sigrex has no backtester, and that is a design consequence, not a missing feature. A strategy here can read any API and ask any LLM, and you can't replay that from history. What you can do is run the strategy on the live market with nothing attached to it, and watch.
Why a backtester doesn't fit Sigrex
A backtest replays the past. It feeds old data into your rules and counts what would have happened. That works when two things are true: every input the strategy uses has a recorded history, and the same input always produces the same decision.
On most platforms both are true, because a strategy is a set of indicator rules over price candles. On Sigrex neither is guaranteed.
Code Strategies read the outside world. With $.Http a strategy can call any API: funding rates, Polymarket odds, a news feed, your own server. Price candles have a history. Most of those other sources keep no record of what they returned at 14:32 three months ago. If the input can't be replayed, the decision can't be either.
LLM Sessions don't give the same answer twice. The same prompt can come back as a buy on one run and a hold on the next. The model can also call web_fetch in the middle of a run and read whatever a page says today. And a model trained on last year's data already knows what the market did back then, so a backtest over that period measures memory as much as judgment.
What the strategy reads | Can it be replayed from history? |
|---|---|
Price candles | Yes |
An external API through | Only if the provider keeps history |
A live web page through | No |
An LLM's decision | No, it varies from run to run |
A backtester that covered only the first row would give you a precise-looking number for a strategy you are not actually running.
Forward testing: run it live, with nothing attached
Forward testing means running the real strategy on the real market and recording what it would have done, with no money behind it. Sigrex makes this easy because the part that decides and the part that trades are separate.
A strategy never places an order. It sends a signal to a Bot Webhook, and the Signal Bots listening on that webhook do the trading. So the setup is short:
- Create a Bot Webhook.
- Create your strategy with signal sending turned on, pointed at that webhook.
- Attach no bot.
- Activate the strategy.
Everything now runs as it would in production: live prices, real API calls, real LLM calls, real timing. The signals go out and nothing executes them. Each one lands in the signal log, and the strategy remembers its last action and the price it fired at.
To get a score, let the strategy keep its own books in $.Storage:
const price = await $.getExchangeRate($.Exchange.BINANCE, "btcusdc");
if (price === null) return;
const state = (await $.Storage.get()) || { entry: null, pnl: 0, trades: 0 };
if (state.entry === null && shouldEnter(price)) {
await $.Strategy.action($.Action.LONG);
state.entry = price;
} else if (state.entry !== null && shouldExit(price, state.entry)) {
await $.Strategy.action($.Action.EXIT);
state.pnl += ((price - state.entry) / state.entry) * 100;
state.trades++;
state.entry = null;
}
await $.Storage.set(state);shouldEnter and shouldExit are your own rules. After a few days you have a trade count and a running P&L for a strategy that never touched your account.
What two minutes of forward testing caught
We wrote a BTCUSDC test strategy: RSI(14) and three EMAs over the strategy's own stored prices, with an entry on a pullback in an uptrend. On paper it looked fine.
We switched it on with no bot attached. Within a minute it had finished a warm-up of 50 samples, opened a position and closed it again at 0.00%. The storage showed why. A Code Strategy runs on every price update, which for BTC is several times a second. Our RSI covered the last few seconds of trading, so the strategy was reacting to noise.
A candle backtest would have passed this strategy, because a backtest hands you tidy one-minute bars. The live runtime doesn't. The fix was to build one-minute bars inside the strategy from Date.now() and move the indicators forward only when a bar completes.
So a forward test checks more than your rules. It also checks the place they run: how often the code wakes up, the 1750 ms HTTP timeout, the 5-second HTTP cache, the one-action-per-run limit.
More ways to test on Sigrex
Run a tournament
Duplicate the strategy a few times and change one threshold in each copy. Every copy sees the same market at the same moment, so the comparison is fair. After a week, keep the winner. An LLM Session can act as the judge, since it has tools to read other strategies' signal logs and settings.
Warm up with real history
Having no backtester doesn't put history off limits. A Code Strategy can pull past candles from an exchange's public API with $.Http.get() and feed them into its $.Ta indicators on the first run. That removes the wait while a 50-period EMA fills up. For a rule that uses only price, you can also replay it over those candles as a rough first check, as long as it fits in the 5-second run limit.
Test on a webhook that already has bots
The simplest test needs no flag: a webhook with no bot attached only logs the signals it receives. If the webhook already has bots on it, add "flag": "TEST" to the signal. A TEST signal is logged and is not forwarded to the bots, so you can test on a live webhook without detaching anything. On real signals, add a callback URL and Sigrex posts the execution result back to you.
For LLM Sessions: read first, compare, keep a journal
- Start with signal sending off. The session only writes its analysis, and you read it for a few days.
- Duplicate the session and run both copies on the same prompt. If they often disagree, the prompt leaves too much to chance.
- Tell the model to append its reasoning to storage on every run. Later you can see why it acted, not only that it did.
From idea to real money, in five steps
- Read. For an LLM Session, run with signals off and read what it writes.
- Shadow. Turn signals on, pointed at a webhook with no bot. Keep a virtual P&L.
- Dry run. Attach the bot and post a TEST signal by hand.
- Small. Trade the smallest amount the exchange accepts.
- Full size. Only after the small run behaves like the shadow run did.
The honest limits
Forward testing is slower and thinner than a backtest, and it is worth knowing where.
- It takes real time. A week of testing covers one week of market. A strategy that looked good in a quiet week has not seen a crash.
- Few trades prove little. Ten trades are an anecdote. Let it run until the count means something.
- A virtual P&L is optimistic. It ignores fees, slippage and rejected orders. Step 4 exists to catch those.
- LLM runs cost money in shadow mode too. Every run is a real call on your own LLM key.
None of this proves a strategy is profitable. To be fair, a backtest doesn't either. It proves the strategy would have made you rich last year, and last year is no longer accepting orders. A forward test shows that the strategy does what you meant it to do, on the market as it is today, before any money depends on it.
Happy testing.


