A long-only breakout that buys when the bar's high tops the highest close of the last 2 bars. It exits on a stop of 6 price units or after 21 bars in the trade. It was tested on daily charts of indices, oil and Gold, plus Gold 4 hours.
Best run of 5. Dow Jones, Daily, spread 3, from run pf:2026-09-24-DOW30-D.tsv:2.
| Period | Up to 2026-09-25 |
| 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-25 |
| positionSize Contracts per trade | 1 |
| channelPeriod Bars for the highest close | 2 |
| maxBarsInTrade Time exit bar count | 20.8 |
| pyramidDistance Add-on distance above entry | 5 |
| stopLossDistance Protective stop in price units | 6 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Dow JonesBest run | Daily | 2.42 | 6,324 | 3.56 | 52,367 EUR | -6,958 |
| Brent Crude | Daily | n/a | 3,335 | 1.32 | 13,153 EUR | -6,372 |
| S&P 500 | Daily | n/a | 2,932 | 12.24 | 2,923 EUR | -954 |
| Gold | Daily | n/a | 2,288 | 13.81 | 2,684 EUR | -1,233 |
| Gold | 4 hours | n/a | 4,585 | 17.73 | 2,124 EUR | -1,509 |
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.
// ============================================================ // Turtle Trade // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long only // Timeframe tested: Daily // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade channelPeriod = 2 // bars for the highest close maxBarsInTrade = 20.8 // time exit, fires once 21 bars in the trade are counted pyramidDistance = 5 // add-on distance above entry, in price units stopLossDistance = 6 // protective stop, in price units ONCE barsInTrade = 0 // --- Indicators --- channelHigh = Highest[channelPeriod](close)
24 more lines: the entry and exit rules.
Read this first
Questions
Yes. An add-on leg exists in the code but stays inactive because orders do not accumulate. The rewritten code was not compile-checked, so backtest it first.
All four other runs were positive. Brent Crude daily made EUR 13,152.6, while S&P 500 daily made EUR 2,922.5 and Gold daily EUR 2,683.8.
The Dow Jones daily best run had a max drawdown of EUR 6,957.7 against EUR 52,366.8 net profit over 6,324 trades.
The 21 bar time exit is meant to hold for about a month on daily charts, which gave the best result.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.