Join waitlist
Strategies / Volatility / Volatility Spike Candle Switch

Volatility Spike Candle Switch

A volatility index based on the 22-bar high close and low spikes above its 20-bar average plus 2 standard deviations. The system buys when a spike holds and the candle turns bullish, and sells short when it turns bearish.

VolatilityLong & shortSwingS&P 5004 hours
n/aProfit factor
820Net profit EUR
38.89%Win rate
522Trades
-506Max drawdown
1.57Avg trade

Best run of 3. S&P 500, 4 hours, spread 1, from run sweeps:2026-10-03-USA500-4h-opt.tsv:29.

Entry rules, long

  1. The volatility index is at or above its 20-bar average plus 2 standard deviations on this bar and the previous bar.
  2. If a long is already open, a repeat signal resets the stop and target from this bar's close.

Entry rules, short

  1. The volatility index is at or above its 20-bar average plus 2 standard deviations on this bar and the previous bar.
  2. If a short is already open, a repeat signal resets the stop and target from this bar's close.

Exit rules

  1. The target is 1.5 times the stop distance from the fill.
  2. An opposite signal reverses the position.

Test conditions

PeriodUp to 2026-10-03
InstrumentS&P 500, 4 hours
Spread1 points
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-10-03

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
S&P 500Best run4 hoursn/a 52238.89820 EUR-506
Nasdaq 1004 hoursn/a 48336.853,420 EUR-3,112
S&P 500Dailyn/a 28139.86924 EUR-577

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Volatility Spike Candle Switch
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Volatility
// Direction: Long & short
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

highc = highest[22](close)
vi = (highc - low) / highc * 100
viupper = Average[20](vi) + 2.0 * STD[20](vi)

31 more lines: the entry and exit rules.

Setup

How to load it

  1. Copy the code with the copy button on the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Indicators used

ATRSMAStandard Deviation
Read this firstKnown weaknesses2 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 506 EUR is large next to the net profit of 820 EUR.

Questions

About this strategy

Can I run Volatility Spike Candle Switch in ProOrder?

Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.

Which markets was it tested on?

It was tested on 3 market and timeframe combinations. The best run by trade count was S&P 500, 4 hours, with 522 trades.

How large was the drawdown?

The best run had a maximum drawdown of 506 EUR at the tested position size, against a net result of 820 EUR.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

CCI Sign With EMA Alignment

Best run on the same market, S&P 500.

1.23 PF · 1,253 trades

Bollinger Squeeze

Also a volatility strategy.

14.30 PF · 86 trades

See how ProRealAlgos combines strategies like this into one automated portfolio.

Copy trading on US indices is available to ProRealAlgos members as spots open.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs