Join waitlist
Strategies / Trend / STC Turn ATR Trail Filter

STC Turn ATR Trail Filter

Buys when the ATR trailing state is up, STC turns up, and the close is at or above the 200-period SMA. Sells short on the mirror setup, with stops at the trailing level and targets set from ATR.

TrendLong & shortSwingGoldDaily
n/aProfit factor
736Net profit EUR
58.20%Win rate
244Trades
-581Max drawdown
3.02Avg trade

Best run of 2. Gold, Daily, spread 0.6, from run sweeps:2026-10-12-GOLD-D-opt.tsv:110.

Entry rules, long

  1. The ATR trailing state is not down, where it turns down when the close crosses below the trailing line (ATR 5 period, 3.5 multiplier).
  2. The close is at or above the 200-period SMA.

Entry rules, short

  1. The ATR trailing state is down, after the close crosses below the trailing line.
  2. The close is below the 200-period SMA.

Exit rules

  1. A short closes when the ATR trailing state turns up.
  2. Stops sit at the trailing level, measured from the fill price, and are skipped if the level is on the wrong side.
  3. Each trade has a target 2 times the 5-period ATR from the fill.

Test conditions

PeriodUp to 2026-10-12
InstrumentGold, Daily
Spread0.6 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-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GoldBest runDailyn/a 24458.20736 EUR-581
Nasdaq 100Dailyn/a 22355.619,004 EUR-2,421

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// STC Turn ATR Trail Filter
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE kone = 0
ONCE done = 0
ONCE ktwo = 0
ONCE stc = 0
ONCE stcinit = 0
ONCE ts = 0
ONCE pos = 0

myMacd = ExponentialAverage[26](close) - ExponentialAverage[50](close)
lowm = lowest[12](myMacd)
rngm = highest[12](myMacd) - lowm

74 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

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

Questions

About this strategy

Can I run STC Turn ATR Trail 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 2 market and timeframe combinations. The best run by trade count was Gold, Daily, with 244 trades.

How large was the drawdown?

The best run had a maximum drawdown of 581 EUR at the tested position size, against a net result of 736 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 Breakout

Best run on the same market, Gold.

1.08 PF · 6,065 trades

ADX Filtered EMA Cross

Also a trend strategy.

1.15 PF · 607 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