Chapter 2 of 7All chapters
Part 1 · Build · Chapter 2 of 7
Read it and watch it run
Chapter 2 video
In this video6 parts · 3:26
- You’ll need
- The strategy from chapter 1 on your deck.
- You’ll end with
- You can say, candle by candle, why it entered and why it left.
- Time
- 10 min
Do it in Spera as you read
Opens in a new tab. Keep this page beside it and follow the steps.
Before you ask whether a strategy makes money, check that it does what you meant. Most surprises in a backtest are a strategy doing exactly what it was told, when that wasn't what you meant. This is true whether you wrote it, copied it, or the AI built it.
1. Read the deck top to bottom
The Logic Deck is your strategy as a stack of steps, read from top to bottom:
- Data steps read the market (Price).
- Indicators compute from data (EMA 20).
- Conditions turn numbers into true or false (Price crosses above EMA).
- Actions trade: an Entry fires when its When is true; an Exit closes the position, on its own rules or its brackets (Stop loss 2%).
For each card, ask: what does it read, and what does it hand on? Check that the Entry's When is your condition, the Exit is linked to the Entry, and every number is what you meant.
Tip
Hover a card's settings for a short explanation. For the full contract of any step (inputs, outputs, defaults and gotchas), open its page in the node reference.
2. Look at the chart
The chart shows the pair and timeframe you're building on. Pick them from the chart toolbar, along with how many candles to load (the Max control). More candles means more history for the strategy to trade.
The chart is for seeing. All strategy values are computed by the engine, the same one that runs backtests and bots. Charts & candles covers pairs, timeframes and loading.
3. Step through it
Stepping through runs the strategy one candle at a time so you can watch every decision.
- Open the Backtest panel and press Run Backtest under Quick. (Chapter 3 is about the results; for now you just need the run.)
- In the results toolbar, press Step through.
- A playback bar appears under the chart. Press Play, or move one candle at a time with Next candle and Previous candle. Next trade candle and Previous trade candle jump straight to where something happened.
While it plays, Step details under the Backtest panel shows what each step computed on that candle and Signals this step shows what fired. Drag the scrubber to jump anywhere. Stop simulation ends it.
4. Check one trade in each direction
Find one entry and one exit and explain each to yourself:
- The entry. On that candle, did price really close above the EMA after being below it? If the strategy enters on candles where you wouldn't, the condition isn't what you meant.
- The exit. Was it the 2% stop? Look at the trade's reason. If trades close where you didn't expect, check the Exit's rules and brackets.
Fix it now, not later
If a trade surprises you here, fix the deck before you go on. Every later chapter measures the strategy you built. If it isn't the strategy you meant, those numbers describe the wrong strategy.
Check your work
Look in Spera and tick what’s true. It only helps you keep your place; nothing is locked.
Go deeper in the docs
Optional. You don’t need these to carry on.
Next up · Chapter 3
Run your first backtest
A quick backtest you can read — and one you know not to trust yet.