This 1 minute scalper looks for a bar that pokes outside a 0.4% envelope around the 20 SMA and closes back inside. It enters only when ADX(40) is above 10 and the DI lines agree with the direction. Each trade has a 30 point stop and a 10 point target.
Best run of 1. Gold, 1 min, spread 0.6, from run sweeps:2026-09-17-GOLD-1m-opt.tsv:2.
| Period | Up to 2026-09-17 |
| Instrument | Gold, 1 minute |
| Spread | 0.6 points |
| Contracts | 5 |
| 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-17 |
| positionSize Shares per trade | 5 |
| bandPeriod Envelope SMA length | 20 |
| upperFactor Upper envelope, 0.4% above the SMA | 1.004 |
| lowerFactor Lower envelope, 0.4% below the SMA | 0.996 |
| adxPeriod ADX and DI length | 40 |
| adxThreshold Minimum ADX reading | 10 |
| stopLossPoints Protective stop in points | 30 |
| takeProfitPoints Profit target in points | 10 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 1 min | n/a | 715 | 75.94 | 2,169 EUR | -1,257 |
Charts
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.
// ============================================================ // Envelope ADX // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 1 minute // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 5 // shares per trade bandPeriod = 20 // envelope SMA length upperFactor = 1.004 // upper envelope, 0.4% above the SMA lowerFactor = 0.996 // lower envelope, 0.4% below the SMA adxPeriod = 40 // ADX and DI length adxThreshold = 10 // minimum ADX reading stopLossPoints = 30 // protective stop in points takeProfitPoints = 10 // profit target in points // --- Indicators --- upperBand = Average[bandPeriod](close) * upperFactor lowerBand = Average[bandPeriod](close) * lowerFactor adxValue = ADX[adxPeriod] plusDI = DIplus[adxPeriod](close) minusDI = DIminus[adxPeriod](close)
16 more lines: the entry and exit rules.
Read this first
Questions
Yes. The stop and target are coded into the system, which trades 5 contracts per signal.
Gold 1 minute made EUR 2,168.50 over 715 trades with a 75.94% win rate. No other market was tested.
At 5 contracts the max drawdown was EUR 1,256.50, more than half the net profit. Margin depends on your broker.
The 10 point target is tiny, so the system needs fast bars to reach it quickly. The test used a 0.6 point spread, and real costs may differ.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.