The system compares the 100-period SMA with its own value 20 bars earlier. A rising average means long and a falling one means short, and each new signal reverses the position. Once the first signal appears it is always in the market.
Best run of 18. USD/JPY, Daily, spread 1, from run pf:2026-09-24-USDJPY-D.tsv:3.
| Period | Up to 2026-09-25 |
| Instrument | USD/JPY, Daily |
| Spread | 1 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-25 |
| positionSize Contracts per trade | 1 |
| trendPeriod SMA length | 100 |
| slopeBars Compare the SMA with its value this many bars ago | 20 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 2.11 | 126 | 42.86 | 2,750,130 JPY | -489,200 |
| EUR/USD | Daily | 1.93 | 111 | 40.54 | 191,085 USD | -37,073 |
| USD/JPY | 10 min | n/a | 2,062 | 35.21 | 605,490 JPY | -245,560 |
| USD/JPY | 30 min | n/a | 2,021 | 32.76 | 469,990 JPY | -236,850 |
| USD/JPY | 5 min | n/a | 2,055 | 34.06 | 342,800 JPY | -125,390 |
| Silver | 2 min | n/a | 2,184 | 33.06 | 30,326 USD | -16,261 |
| GBP/USD | Daily | n/a | 132 | 41.67 | 22,707 USD | -9,529 |
| US Crude Oil | Daily | n/a | 127 | 33.86 | 14,724 EUR | -8,481 |
| Nasdaq 100 | Daily | n/a | 76 | 38.16 | 13,543 EUR | -5,605 |
| Brent Crude | 1 hour | n/a | 650 | 33.85 | 7,580 EUR | -4,611 |
| Dow Jones | 5 min | n/a | 2,210 | 32.17 | 7,374 EUR | -6,770 |
| Gold | Daily | n/a | 132 | 40.15 | 3,656 EUR | -1,108 |
| Gold | 10 min | n/a | 2,087 | 33.11 | 3,242 EUR | -990 |
| Gold | 1 hour | n/a | 1,151 | 34.32 | 2,967 EUR | -1,164 |
| Gold | 4 hours | n/a | 345 | 33.04 | 1,691 EUR | -1,205 |
| S&P 500 | 4 hours | n/a | 275 | 37.82 | 1,342 EUR | -1,325 |
| Gold | 15 min | n/a | 2,107 | 30.90 | 1,172 EUR | -1,056 |
| Gold | 2 min | n/a | 2,176 | 32.35 | 1,161 EUR | -827 |
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.
// ============================================================ // MA Slope Momentum // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: Daily // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade trendPeriod = 100 // SMA length slopeBars = 20 // compare the SMA with its value this many bars ago // --- Indicators --- trendMA = Average[trendPeriod](close)
14 more lines: the entry and exit rules.
Read this first
Questions
Yes, it is a stop-and-reverse system that ProOrder can run. The code was rewritten without a compile check, and the stats are from the version before that.
Ten instruments from 2 minutes to Daily. EUR/USD Daily had a profit factor of 1.93 over 111 trades, and all rows were profitable.
At 1 contract, USD/JPY Daily had a max drawdown of JPY 489,200. There is no flat period, so overnight and weekend gaps always hit an open position.
The two runs with a recorded profit factor were both Daily. On faster bars the 100 SMA slope flips more often and trade count rises sharply.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.