Hands-on tutorials
Example 2: RSI Range Reversion
Use RSI(14), cross above 30 to enter and cross below 70 to exit. Learn the difference between a cross and a state.
Read the template before copying
The current template opens a long when RSI crosses above 30 while flat and closes it when RSI crosses below 70 while long. It does not buy merely because RSI is below 30, and it does not close merely because RSI rises above 70.
For input ports and fixed values, read “Left input port reference” and “Fixed value or strategy parameter?” in Build a visual strategy.
- Entry: RSI crosses upward through 30 while flat.
- Exit: RSI crosses downward through 70 while a long position exists, or the configured protection triggers.
- The preview lists 1 integer unit, 2% stop loss and 4% take profit. Review these again in your copied project.
Create the model and check its inputs
- Open Strategy Templates → RSI Range Reversion → Use Template. Name the copy “Lesson 2 · RSI Range”.
- In My Strategies set the RSI node to period 14 and connect the selected bar Close to its Input Price. Keep a single calculation source and timeframe.
- Connect RSI to the left value of Cross Above and Cross Below. Use ratio-compatible values for the right inputs: Entry Level 30 and Exit Level 70. The template already includes these parameter nodes.
- Connect Cross Above to the long-entry condition and Cross Below to the close condition. In Condition Rules read “RSI crosses above 30” and “RSI crosses below 70”.
- Keep entry only when flat and a full-position reduce-only exit. Review 1 integer unit, 2% stop loss and 4% take profit; check and save the project.
A crossing event needs two valid values
These are illustrative RSI values, not an actual test dataset. The downward exit through 70 requires RSI to have reached or exceeded 70 first. If it never does, protection can still close the position. Do not add a new exit rule without intending to change the strategy.
| Previous RSI → current RSI | Condition | Expected action |
|---|---|---|
| 28 → 32 | Crosses above 30 | If flat, request a long entry |
| 32 → 36 | Still above 30 | No new entry |
| 68 → 72 | Rises above 70 | No threshold exit |
| 72 → 68 | Crosses below 70 | If long, request a close |
| Invalid warm-up → first valid value | No valid previous pair | Not a cross |
Use the same replay workflow
- Open Replay Settings and select “Lesson 2 · RSI Range”. Use the same dataset, simulated capital, sizing, leverage and fee settings as Example 1 if you want a controlled comparison.
- Check protection and Trading Costs. A fill notional of 1,000 at a fee rate of 0.1% incurs a fee of 1 in the quote currency; a later exit has its own fee.
- Save Settings and Play. In chart indicator settings add RSI with period 14 and the same source/timeframe. Chart display settings do not rewrite the strategy node.
- Pause near the first fill. Compare the two confirmed RSI values around 30, the signal time, the fill time and the position/order logs.
- The screenshot uses 2% stop loss and 4% take profit. They are percentages of the position average fill price, not of leverage.
- Fee Rate is entered as a percentage: 0.1 means 0.1%, not 10%. Each fill is charged separately.
- Save Settings, then Play in Replay Controls. Pause and Next Bar help inspect a fill; Stop discards the current execution state for a fresh run.
What to check before moving on
Success means the configured rules match the signals and fills, not that the return must be positive. After one completed entry and exit, move to the MACD + RSI lesson to combine conditions.
- No entry? Check warm-up and whether RSI actually crossed upward through 30 during the selected trading interval.
- A close before the downward 70 cross? Inspect whether the 2% stop loss or 4% take profit fired.
- Many buys in a row? Check that Cross Above is used rather than Greater Than, and that the entry is guarded by a flat position.
- No fills despite a signal? Read rejection logs for contract quantity, available margin and fees.
For the current Desktop workflow. Labels and available capabilities can vary by application version and connected provider.