Join waitlist
Strategies / Trend / Supertrend Midline Filter

Supertrend Midline Filter

Buys when a Supertrend flips to uptrend while the close is above the 50-period average, and sells short on a downtrend flip with the close below it. Stops are 1.5 times ATR(14) and targets 1.5 times the stop distance.

TrendLong & shortSwingSilver4 hours
3.23Profit factor
176,799Net profit USD
38.30%Win rate
637Trades
-12,812Max drawdown
278Avg trade

Best run of 14. Silver, 4 hours, spread 2, from run pf:2026-10-04-SILVER-4h.tsv:5.

Entry rules, long

  1. The close is above the 50-period average.

Entry rules, short

  1. The close is below the 50-period average.

Exit rules

  1. The target sits 1.5 times the stop distance from the entry price.

Test conditions

PeriodUp to 2026-10-04
InstrumentSilver, 4 hours
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 run4 hours3.23 63738.30176,799 USD-12,812
Gold4 hours1.30 63741.601,410 EUR-336
Nikkei 225Dailyn/a 27244.8521,997 USD-6,144
Dow Jones4 hoursn/a 21346.0113,879 EUR-4,247
Dow JonesDailyn/a 30443.4210,087 EUR-4,235
US Crude Oil1 hourn/a 1,83240.996,715 EUR-1,942
US Crude OilDailyn/a 22744.496,400 EUR-2,543
Nasdaq 1004 hoursn/a 75738.715,655 EUR-3,160
Brent Crude1 hourn/a 1,34941.145,138 EUR-2,091
Brent CrudeDailyn/a 10347.575,109 EUR-3,033
US Crude Oil4 hoursn/a 52041.924,402 EUR-2,429
Brent Crude4 hoursn/a 40143.644,032 EUR-4,019
S&P 5004 hoursn/a 71840.251,835 EUR-833
GoldDailyn/a 28441.55679 EUR-389

Charts

Results by run

Top 10 of 14 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

// ==============================================================
// Supertrend Midline Filter
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE fub = 0
ONCE flb = 0
ONCE dir = 1

myAtr = AverageTrueRange[10](close)
ub = MedianPrice + 3.0 * myAtr
lb = MedianPrice - 3.0 * myAtr

50 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

SuperTrendATRSMA
Longer historyRe-run on up to 1,000,000 barsGold · 4 hours · older data 0.00 EUR

Gold had no history beyond the standard run, so both runs used 30,000 bars.

Gold · 4 hours

Bars available30,000
Net, standard 200,000-bar run1,410.10 EUR
Net, long run1,410.10 EUR
Net on the older data alone0.00 EUR
Read this firstKnown weaknesses2 points
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run Supertrend Midline Filter 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 14 market and timeframe combinations. The best run was Silver, 4 hours, with a profit factor of 3.23 over 637 trades.

How large was the drawdown?

The best run had a maximum drawdown of 12,812 USD at the tested position size, against a net result of 176,798 USD.

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

SMA Crossover With RSI Exit

Best run on the same market, Silver.

2.13 PF · 8,999 trades

EMA 50 200 Pullback RSI

Also a trend strategy.

3.25 PF · 155 trades

Put your name on the ProRealAlgos waitlist to trade a tested portfolio instead of single strategies.

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