Three Stochastic lines of increasing length act as fast, medium and slow cycles. A long opens when they are stacked fast over medium over slow, the fast cycle is well above the slow one, and either the cycles are rising or volume confirms. The trade closes when the stack breaks or the fast cycle turns down.
Best run of 10. Dow Jones, Daily, spread 3, from run pf:2026-09-28-DOW30-D.tsv:1.
| Period | Up to 2026-09-28 |
| Instrument | Dow Jones, 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-28 |
| positionSize Contracts per trade | 1 |
| fastCyclePeriod Short cycle stochastic lookback | 13 |
| fastCycleSmooth Short cycle smoothing | 8 |
| midCyclePeriod Medium cycle lookback | 21 |
| midCycleSmooth Medium cycle smoothing | 13 |
| slowCyclePeriod Long cycle lookback | 34 |
| slowCycleSmooth Long cycle smoothing | 21 |
| volumePeriod Average volume length | 21 |
| strengthLevel Minimum cycle strength, percent | 10 |
| volumeRatioLevel Volume multiple of its average | 1.2 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Dow JonesBest run | Daily | 1.62 | 485 | 46.39 | 16,402 EUR | -2,876 |
| DAX 40 | Daily | 1.46 | 522 | 41.95 | 9,104 EUR | -1,976 |
| USD/JPY | Daily | n/a | 604 | 46.69 | 517,220 JPY | -300,850 |
| EUR/USD | 2 min | n/a | 8,902 | 22.71 | 152,668 USD | -89,504 |
| Nikkei 225 | Daily | n/a | 414 | 44.44 | 20,056 USD | -7,132 |
| Nasdaq 100 | 4 hours | n/a | 1,158 | 41.71 | 7,023 EUR | -3,739 |
| Nasdaq 100 | Daily | n/a | 396 | 39.90 | 3,124 EUR | -2,386 |
| FTSE 100 | Daily | n/a | 474 | 46.20 | 2,043 EUR | -1,890 |
| S&P 500 | Daily | n/a | 527 | 38.71 | 1,216 EUR | -581 |
| Gold | 4 hours | n/a | 1,219 | 41.84 | 1,112 EUR | -461 |
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.
// ============================================================ // Market Cycle // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long only // Timeframe tested: Daily // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade fastCyclePeriod = 13 // short cycle stochastic lookback fastCycleSmooth = 8 // short cycle smoothing midCyclePeriod = 21 // medium cycle stochastic lookback midCycleSmooth = 13 // medium cycle smoothing slowCyclePeriod = 34 // long cycle stochastic lookback slowCycleSmooth = 21 // long cycle smoothing volumePeriod = 21 // average volume length strengthLevel = 10 // minimum cycle strength, percent volumeRatioLevel = 1.2 // volume must be this multiple of its average ONCE inTrade = 0 // own position flag, as published // --- Indicators --- fastCycle = Stochastic[fastCyclePeriod, fastCycleSmooth](close) midCycle = Stochastic[midCyclePeriod, midCycleSmooth](close) slowCycle = Stochastic[slowCyclePeriod, slowCycleSmooth](close) cyclesAligned = fastCycle > midCycle AND midCycle > slowCycle cycleStrength = (fastCycle - slowCycle) / slowCycle * 100 fastCycleMom = fastCycle - fastCycle[1] midCycleMom = midCycle - midCycle[1] volumeRatio = volume / Average[volumePeriod](volume) volumeStrength = volumeRatio * (fastCycleMom > 0) strongCycle = cycleStrength > strengthLevel risingMomentum = fastCycleMom > 0 AND midCycleMom > 0 volumeSurge = volumeStrength > volumeRatioLevel
17 more lines: the entry and exit rules.
Read this first
Questions
Yes, it is written for automated trading at 1 contract, long only.
Dow Jones daily gave profit factor 1.62 and EUR 16,402.00 over 485 trades. DAX 40 daily followed at 1.46, and every tested market ended in profit.
The Dow Jones daily run had a max drawdown of EUR 2,875.70 at 1 contract.
Stochastic cycles of 13, 21 and 34 bars describe multi-week swings on daily charts. The EUR/USD 2 minute run traded 8,902 times with a low win rate.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.