Join waitlist
Strategies / Pattern / Negated Hammer

Negated Hammer

When a bar with its body in the bottom third of its range is followed by a strong bar that opens and closes wholly above it, the system buys, as long as price is above the 5, 10 and 50-period SMAs. The short side mirrors this. Exits use a trailing stop of 18 points for longs and 24 for shorts.

PatternLong & shortSwingNasdaq 1001 hour
3.20Profit factor
8,515Net profit EUR
87.10%Win rate
372Trades
-2,494Max drawdown
22.89Avg trade

Best run of 17. Nasdaq 100, 1 hour, spread 3, from run pf:2026-09-16-NAS100-1h.tsv:2.

Entry rules, long

  1. Previous bar has its body in the bottom third of its range
  2. Close is above the 5, 10 and 50-period SMAs

Entry rules, short

  1. Previous bar has its body in the top third of its range
  2. Close is below the 5, 10 and 50-period SMAs

Exit rules

  1. No fixed stop loss or target

Test conditions

PeriodUp to 2026-09-16
InstrumentNasdaq 100, 1 hour
Spread3 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-16
Parameters (7)
positionSize
Contracts per trade
1
fastPeriod
Fast SMA length
5
midPeriod
Middle SMA length
10
slowPeriod
Slow SMA length
50
minBodyRatio
Signal candle body must exceed this share of its range
0.5
longTrailPoints
Trailing stop distance for longs (points)
18
shortTrailPoints
Trailing stop distance for shorts (points)
24

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Nasdaq 100Best run1 hour3.20 37287.108,515 EUR-2,494
Silver4 hours2.57 10489.4216,440 USD-3,416
S&P 5001 hour1.50 26978.441,753 EUR-1,015
Brent Crude30 min1.44 46890.175,000 EUR-2,604
S&P 50015 min1.43 41175.182,401 EUR-1,049
Gold1 hour1.42 26667.291,366 EUR-1,263
FTSE 1001 hour1.28 35985.791,933 EUR-894
FTSE 10030 min1.27 70978.703,362 EUR-1,091
DAX 401 hour1.26 38391.383,240 EUR-2,417
Nasdaq 10010 min1.19 63188.433,319 EUR-2,614
USD/JPY3 min1.15 77459.04145,340 JPY-110,190
GBP/USD10 min1.12 59371.161,160 USD-902
FTSE 1005 min1.10 68161.53918 EUR-661
Brent Crude10 min1.07 72384.921,207 EUR-1,453
USD/JPY4 hoursn/a 9296.74275,680 JPY-127,470
Brent Crude4 hoursn/a 6592.312,609 EUR-1,991
Nasdaq 100Dailyn/a 3193.551,176 EUR-623

Charts

Results by run

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

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder, rewritten to house standard

// ============================================================
// Negated Hammer
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Pattern
// Direction: Long & short
// Timeframe tested: 1 hour
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = false
DEFPARAM PreloadBars = 1000

// --- Parameters ---
positionSize = 1          // contracts per trade
fastPeriod = 5            // fast SMA length
midPeriod = 10            // middle SMA length
slowPeriod = 50           // slow SMA length
minBodyRatio = 0.5        // signal candle body must exceed this share of its range
longTrailPoints = 18      // trailing stop distance for longs (points)
shortTrailPoints = 24     // trailing stop distance for shorts (points)

// --- Indicators ---
fastMA = Average[fastPeriod](close)
midMA = Average[midPeriod](close)
slowMA = Average[slowPeriod](close)
trendUp = close > fastMA AND close > midMA AND close > slowMA
trendDown = close < fastMA AND close < midMA AND close < slowMA

bodyRatio = abs(open - close) / (high - low)

// Previous bar has its body in the top third (hammer), and this bar's body
// sits wholly below it: the hammer is negated.
prevHammer = MIN(open[1], close[1]) > high[1] - (high[1] - low[1]) / 3
hammerNegated = MAX(open, close) < MIN(open[1], close[1]) AND bodyRatio > minBodyRatio

// Previous bar has its body in the bottom third (inverted hammer), and this
// bar's body sits wholly above it.
prevInvertedHammer = MAX(open[1], close[1]) < low[1] + (high[1] - low[1]) / 3
invertedHammerNegated = MIN(open, close) > MAX(open[1], close[1]) AND bodyRatio > minBodyRatio

39 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

SMA
Read this firstKnown weaknesses4 points
  • There is no fixed stop loss. The trail only starts once the trade is 18 or 24 points in profit, so a losing trade has no protection.
  • No position check before entries, so an opposite signal reverses the trade immediately.
  • Some rows have very few trades, like 31 on Nasdaq 100 Daily and 65 on Brent Crude 4 hours.
  • A win rate of 87.1% in the best run sits next to a max drawdown of EUR 2,493.90, a sign that the losers are large.

Questions

About this strategy

Can I automate the Negated Hammer in ProOrder?

Yes, every rule is automatic, including the separate long and short trails. Run the new code through a compile check first, since the backtest numbers were produced by the older version.

How did it do across markets?

Nasdaq 100 1 hour made EUR 8,515.10 over 372 trades with a profit factor of 3.2. Silver 4 hours had 2.57, and every market tested was profitable.

What is the drawdown at 1 contract?

The best run had a max drawdown of EUR 2,493.90. Silver 4 hours reached USD 3,415.50.

Why do the trails differ for longs and shorts?

Longs use an 18-point trail and shorts 24 points, as tested. Shorts get more room because down moves in these markets tend to be sharper.

Related

Strategies like this one

Bollinger Squeeze

Uses the same indicator.

14.30 PF · 86 trades

Internal Bar Strength

Best run on the same market, Nasdaq 100.

2.00 PF · 905 trades

Bollinger Band Walk

A similar profit factor.

3.10 PF · 148 trades

Want to see pattern strategies tested the same way across every market? Join the ProRealAlgos waitlist.

Copy trading on US indices is available to ProRealAlgos members as spots open.

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