The idea is to buy strength: go long when price has risen more than 44% over the last 130 bars. Exits are a 40% target, a 20% stop or a time exit after 130 bars. Trades are rare and held for months on Daily charts.
Best run of 3. Nasdaq 100, Daily, spread 3, from run sweeps:2026-09-24-NAS100-D-opt.tsv:8.
| Period | Up to 2026-09-24 |
| Instrument | Nasdaq 100, Daily |
| 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-24 |
| positionSize Contracts per trade | 1 |
| momentumPeriod Lookback for the percent return | 130 |
| minReturnPct Buy when the return over the lookback exceeds this percent | 44 |
| maxBarsInTrade Time exit after this many bars | 130 |
| takeProfitPct Profit target, percent of entry price | 40 |
| stopLossPct Protective stop, half the target | 20 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Nasdaq 100Best run | Daily | n/a | 10 | 60.00 | 1,982 EUR | -1,944 |
| Dow Jones | Daily | n/a | 3 | 100.00 | 4,471 EUR | -2,641 |
| S&P 500 | Daily | n/a | 4 | 75.00 | 594 EUR | -343 |
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.
// ============================================================ // Long Horizon Momentum // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long only // Timeframe tested: Daily // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade momentumPeriod = 130 // lookback for the percent return minReturnPct = 44 // buy when the return over that window exceeds this percent maxBarsInTrade = 130 // time exit after this many bars takeProfitPct = 40 // profit target, percent of entry price stopLossPct = takeProfitPct / 2 // stop is half the target // --- Indicators --- returnPct = 100 * (close - close[momentumPeriod]) / close[momentumPeriod]
17 more lines: the entry and exit rules.
Read this first
Questions
Yes, the entry and percent exits are straightforward. Expect very few trades, so a live test will take a long time to judge.
Nasdaq 100 Daily made EUR 1,981.8, Dow Jones Daily EUR 4,470.9 on 3 trades, and S&P 500 Daily EUR 593.83 on 4 trades.
The stop is 20% from entry, which is a large move on an index. The best run's max drawdown was EUR 1,944.1 with 1 contract.
A 44% gain over 130 bars only happens after strong multi month rallies on Daily charts. Shorter bars would make the rule far too rare or meaningless.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.