Join waitlist
Strategies / Momentum / Williams %R Armed MACD Histogram

Williams %R Armed MACD Histogram

It arms a long when Williams %R(140) crosses over -94 with the close above the 7-period SMA, then buys when the MACD histogram turns positive. Short signals mirror this, and a position closes when the histogram falls against it.

MomentumLong & shortSwingDAX 404 hours
n/aProfit factor
2,479Net profit EUR
37.81%Win rate
529Trades
-2,444Max drawdown
4.69Avg trade

Best run of 3. DAX 40, 4 hours, spread 3, from run sweeps:2026-10-07-DAX40-4h-opt.tsv:41.

Entry rules, long

  1. Williams %R(140) crosses over -94 while the close is above the 7-period SMA, which arms the long side.
  2. The long side stays armed until Williams %R crosses over -40.

Entry rules, short

  1. Williams %R(140) crosses under -6 while the close is below the 7-period SMA, which arms the short side.
  2. The short side stays armed until Williams %R crosses under -60.

Exit rules

  1. The short is closed when the MACD histogram rises above its prior value.
  2. No stop loss or profit target is set.

Test conditions

PeriodUp to 2026-10-07
InstrumentDAX 40, 4 hours
Spread3 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-10

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
DAX 40Best run4 hoursn/a 52937.812,479 EUR-2,444
USD/JPYDailyn/a 24238.43383,250 USD-305,300
GBP/USDDailyn/a 24035.423,690 USD-3,362

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Williams %R Armed MACD Histogram
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Momentum
// Direction: Long & short
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE buyactive = 0
ONCE sellactive = 0
ONCE wr = -50

hh = highest[140](high)
ll = lowest[140](low)

41 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

Williams %RSMAMACD
Read this firstKnown weaknesses2 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 2,444 EUR is large next to the net profit of 2,479 EUR.

Questions

About this strategy

Can I run Williams %R Armed MACD Histogram 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 DAX 40, 4 hours, with 529 trades.

How large was the drawdown?

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

Heikin Ashi Color Flip

Best run on the same market, DAX 40.

1.12 PF · 3,692 trades

ATR Momentum

Also a momentum strategy.

n/a PF · 15,021 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