Join waitlist
Strategies / Mean reversion / Harmonic Energy Mean Reversion

Harmonic Energy Mean Reversion

Measures how far the close sits from its 20-bar average in standard deviations and converts that into an energy value. It buys when energy falls below -2.5 and exits once energy returns to zero or above, with no stop or target.

Mean reversionLong onlySwingSilver1 hour
3.44Profit factor
522,663Net profit USD
64.07%Win rate
2,970Trades
-43,878Max drawdown
176Avg trade

Best run of 13. Silver, 1 hour, spread 2, from run pf:2026-10-04-SILVER-1h.tsv:1.

Entry rules, long

  1. Energy is 0.5 x 2 x z squared, signed by z, where z is the close minus its 20-bar SMA over the 20-bar standard deviation.

Exit rules

  1. The long is closed at market when energy is 0 or higher, meaning the close is at or above its 20-bar SMA.

Test conditions

PeriodUp to 2026-10-04
InstrumentSilver, 1 hour
Spread2 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-04

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
SilverBest run1 hour3.44 2,97064.07522,663 USD-43,878
Nasdaq 1004 hours1.59 75770.6715,733 EUR-3,179
Dow JonesDailyn/a 34471.5121,296 EUR-9,764
Nasdaq 100Dailyn/a 26071.5412,718 EUR-3,552
Nikkei 2254 hoursn/a 58966.7211,610 USD-10,202
Dow Jones4 hoursn/a 26370.3411,085 EUR-9,759
DAX 404 hoursn/a 75772.5210,829 EUR-5,335
DAX 40Dailyn/a 35069.718,085 EUR-4,745
Dow Jones15 minn/a 4,15868.867,705 EUR-6,286
FTSE 1004 hoursn/a 73870.465,196 EUR-1,988
FTSE 100Dailyn/a 28673.084,583 EUR-2,941
S&P 5004 hoursn/a 77070.913,543 EUR-1,028
S&P 500Dailyn/a 36073.333,498 EUR-1,040

Charts

Results by run

Top 10 of 13 runs. The full list is in the table above.

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// Harmonic Energy Mean Reversion
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long only
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

sd = STD[20](close)

16 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

SMAStandard Deviation
Longer historyRe-run on up to 1,000,000 barsNasdaq 100 · 4 hours · older data 0.00 EUR

Nasdaq 100 had no history beyond the standard run, so both runs used 28,000 bars.

Nasdaq 100 · 4 hours

Bars available28,000
Net, standard 200,000-bar run15,733.00 EUR
Net, long run15,733.00 EUR
Net on the older data alone0.00 EUR
Read this firstKnown weaknesses2 points
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run Harmonic Energy Mean Reversion 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 13 market and timeframe combinations. The best run was Silver, 1 hour, with a profit factor of 3.44 over 2,970 trades.

How large was the drawdown?

The best run had a maximum drawdown of 43,878 USD at the tested position size, against a net result of 522,663 USD.

Does it trade long, short or both?

It only takes long trades.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

SMA Crossover With RSI Exit

Best run on the same market, Silver.

2.13 PF · 8,999 trades

Three Red Days Volatility Filter

Also a mean reversion strategy.

3.43 PF · 271 trades

Get the full rules, the complete code and the ProRealAlgos portfolio as a member.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

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