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.
Best run of 17. Nasdaq 100, 1 hour, spread 3, from run pf:2026-09-16-NAS100-1h.tsv:2.
| Period | Up to 2026-09-16 |
| Instrument | Nasdaq 100, 1 hour |
| Spread | 3 points |
| Contracts | 1 |
| Starting capital | 1,000,000 |
| Costs | Spread only. Commissions and overnight financing are not included. |
| Bars | Up to 200,000 bars, fewer where the instrument has less history |
| Last tested | 2026-09-16 |
| 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
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Nasdaq 100Best run | 1 hour | 3.20 | 372 | 87.10 | 8,515 EUR | -2,494 |
| Silver | 4 hours | 2.57 | 104 | 89.42 | 16,440 USD | -3,416 |
| S&P 500 | 1 hour | 1.50 | 269 | 78.44 | 1,753 EUR | -1,015 |
| Brent Crude | 30 min | 1.44 | 468 | 90.17 | 5,000 EUR | -2,604 |
| S&P 500 | 15 min | 1.43 | 411 | 75.18 | 2,401 EUR | -1,049 |
| Gold | 1 hour | 1.42 | 266 | 67.29 | 1,366 EUR | -1,263 |
| FTSE 100 | 1 hour | 1.28 | 359 | 85.79 | 1,933 EUR | -894 |
| FTSE 100 | 30 min | 1.27 | 709 | 78.70 | 3,362 EUR | -1,091 |
| DAX 40 | 1 hour | 1.26 | 383 | 91.38 | 3,240 EUR | -2,417 |
| Nasdaq 100 | 10 min | 1.19 | 631 | 88.43 | 3,319 EUR | -2,614 |
| USD/JPY | 3 min | 1.15 | 774 | 59.04 | 145,340 JPY | -110,190 |
| GBP/USD | 10 min | 1.12 | 593 | 71.16 | 1,160 USD | -902 |
| FTSE 100 | 5 min | 1.10 | 681 | 61.53 | 918 EUR | -661 |
| Brent Crude | 10 min | 1.07 | 723 | 84.92 | 1,207 EUR | -1,453 |
| USD/JPY | 4 hours | n/a | 92 | 96.74 | 275,680 JPY | -127,470 |
| Brent Crude | 4 hours | n/a | 65 | 92.31 | 2,609 EUR | -1,991 |
| Nasdaq 100 | Daily | n/a | 31 | 93.55 | 1,176 EUR | -623 |
Charts
Above 1.0 made money, below 1.0 lost money.
The code
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.
// ============================================================ // 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.
Read this first
Questions
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.
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.
The best run had a max drawdown of EUR 2,493.90. Silver 4 hours reached USD 3,415.50.
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
Copy trading on US indices is available to ProRealAlgos members as spots open.