Join today
Strategies / Trend / Parabolic SAR Flip

Parabolic SAR Flip Strategy

A trade opens on the bar where the Parabolic SAR flips sides, but only if the smoothed Stochastic and the MACD histogram agree with the new direction. Longs exit when the close falls below the SAR. Shorts have no exit of their own and close only when a long signal reverses them.

TrendLong & shortSwingUSD/JPY1 hour
n/aProfit factor
595,870Net profit JPY
42.14%Win rate
3,536Trades
-349,410Max drawdown
169Avg trade

Best run of 4. USD/JPY, 1 hour, spread 1, from run sweeps:2026-09-22-USDJPY-1h-opt.tsv:2.

Entry rules, long

  1. Members only
  2. 3-bar average of Stochastic(5,3) is above 50
  3. MACD histogram (12,26,9) is above 0

Entry rules, short

  1. Members only
  2. 3-bar average of Stochastic(5,3) is 50 or below
  3. MACD histogram (12,26,9) is below 0

Exit rules

  1. Members only
  2. Shorts close only when a long signal reverses them
  3. No stop loss or target

Test conditions

PeriodUp to 2026-09-22
InstrumentUSD/JPY, 1 hour
Spread1 points
Contracts1
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-09-22

Parameters

positionSize
Contracts per trade
1
sarStart
Parabolic SAR starting acceleration
0.02
sarStep
Acceleration step
0.02
sarMax
Maximum acceleration
0.2
stochPeriod
Stochastic lookback
5
stochSmooth
%K smoothing
3
stochDSmooth
SMA of %K used as the signal
3
stochMidLevel
Longs need the signal above this, shorts at or below
50
macdFast
MACD fast length
12
macdSlow
MACD slow length
26
macdSignalPeriod
MACD signal length
9

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest run1 hourn/a 3,53642.14595,870 JPY-349,410
USD/JPYDailyn/a 35344.761,767,160 JPY-504,600
SilverDailyn/a 35045.4331,566 USD-8,085
DAX 401 hourn/a 2,81241.438,628 EUR-5,071

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-1.0M-500K1.0M2.0MUSD/JPY · DailyUSD/JPY · 1 hourSilver · DailyDAX 40 · 1 hour

The code

ProBuilder, rewritten to house standard

Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.

// ============================================================
// Parabolic SAR Flip
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: 1 hour
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = false

// --- Parameters ---
positionSize = 1       // contracts per trade
sarStart = 0.02        // Parabolic SAR starting acceleration
sarStep = 0.02         // acceleration step
sarMax = 0.2           // maximum acceleration
stochPeriod = 5        // stochastic lookback
stochSmooth = 3        // %K smoothing
stochDSmooth = 3       // SMA of %K used as the signal
stochMidLevel = 50     // longs need the signal above this, shorts need it at or below
macdFast = 12          // MACD fast length
macdSlow = 26          // MACD slow length
macdSignalPeriod = 9   // MACD signal length

// --- Indicators ---
sarValue = SAR[sarStart, sarStep, sarMax]
stochK = Stochastic[stochPeriod, stochSmooth](close)
stochD = Average[stochDSmooth](stochK)
macdHistogram = MACD[macdFast, macdSlow, macdSignalPeriod](close)

23 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • Shorts have no stop and no SAR exit, so they can stay open through long rallies until a new long signal appears.
  • Max drawdown is large next to profit: JPY 349,410.00 against JPY 595,870.00 on the headline USD/JPY 1 hour run.
  • The win rate sits around 41% to 45% in every test, so losing streaks are normal.
  • Profit factor was not recorded, because only optimization sweep data exists.

Indicators used

Parabolic SARStochasticMACD

How to load it

  1. Copy the code with the copy button above 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.

Questions

About this strategy

Can the Parabolic SAR Flip run in ProOrder?

Yes, it is written for automated trading at 1 contract per trade. Be aware that shorts rely on a reversal to close.

What markets were tested?

USD/JPY 1 hour made JPY 595,870.00 over 3,536 trades. USD/JPY daily, Silver daily and DAX 40 1 hour were also profitable, with DAX 40 making EUR 8,628.00 over 2,812 trades.

What risk comes with 1 contract?

The headline run had a max drawdown of JPY 349,410.00. On DAX 40 1 hour it was EUR 5,070.90. Size capital to the instrument you trade.

Why the 1 hour chart?

SAR flips on hourly bars give plenty of signals for the Stochastic and MACD filters to screen. Daily bars trade far less, at 353 trades on USD/JPY.

Related

Strategies like this one

Slow MACD Slope

Uses the same indicator.

6.80 PF · 7,305 trades

Supertrend Counter Trend

Best run on the same market, USD/JPY.

3.47 PF · 1,444 trades

Long-Term Moving Average Cross

Also a trend strategy.

12.31 PF · 61 trades

Trend systems need partners that cover their weak spots. Join the ProRealAlgos waitlist.

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