Ein fraktales Hoch beginnt eine fallende Trendlinie, und ein zweistufiger Bruch dieser Linie aktiviert einen Buy-Stop 0.3 ATR(7) über dem letzten Hoch. Ausstiege nutzen ein exponentielles Band und RSI(2) und schließen Longs, sobald RSI bei 85 oder höher steht und der Preis zurück unter dem oberen Band liegt. Shorts spiegeln die Logik.
Bester von 8 Durchläufen. USD/JPY, 4 Stunden, Spread 1, aus Durchlauf sweeps:2026-09-17-USDJPY-4h-opt.tsv:2.
| Zeitraum | Bis 2026-09-17 |
| Instrument | USD/JPY, 4 Stunden |
| Spread | 1 Punkt |
| Kontrakte | 1 |
| Startkapital | 1,000,000 |
| Kosten | Nur Spread. Kommissionen und Overnight-Finanzierung sind nicht enthalten. |
| Bars | Bis zu 200,000 Bars, weniger wo das Instrument weniger Historie hat |
| Zuletzt getestet | 2026-09-17 |
| positionSize Kontrakte pro Trade | 1 |
| fractalBars Bars, die das Zentrum des 5-bar-Fraktals übertreffen muss (strukturell, bei 4 belassen) | 4 |
| breakoutBars Bars, die für das Breakout Hoch oder Tief verwendet werden | 2 |
| atrPeriod ATR-Länge für den Einstiegspuffer | 7 |
| atrMultiplier Einstiegspuffer über dem Breakout Niveau, in ATRs | 0.3 |
| bandPeriod Länge der exponentiellen Log-Preis-Bänder | 34 |
| seedPeriod SMA-Länge, die die Bänder auf den ersten bars initialisiert | 3 |
| bandWidth Bandbreite in Standardabweichungen | 1.618 |
| rsiPeriod RSI-Länge für den Ausstieg | 2 |
| overboughtLevel RSI-Niveau, das ein Long-Ausstieg benötigt | 85 |
| oversoldLevel RSI-Niveau, das ein Short-Ausstieg benötigt | 15 |
| lookbackPeriod Fenster für das vorherige swing Hoch und Tief | 100 |
Jeder Durchlauf
| Markt | Zeiteinheit | PF | Trades | Treffer % | Netto | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBester Durchlauf | 4 Stunden | n/a | 819 | 53.36 | 161,440 JPY | -93,910 |
| USD/JPY | Täglich | n/a | 300 | 59.00 | 754,540 JPY | -174,840 |
| Nikkei 225 | Täglich | n/a | 262 | 61.07 | 20,201 USD | -12,694 |
| Silber | Täglich | n/a | 255 | 50.59 | 8,055 USD | -2,895 |
| Brent-Rohöl | Täglich | n/a | 119 | 60.50 | 4,755 EUR | -4,645 |
| GBP/USD | Täglich | n/a | 334 | 59.88 | 3,432 USD | -2,003 |
| FTSE 100 | Täglich | n/a | 297 | 54.55 | 2,325 EUR | -948 |
| Gold | Täglich | n/a | 287 | 55.05 | 624 EUR | -317 |
Charts
Der Code
// ============================================================ // Trend Breakout // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: 4 hours // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade fractalBars = 4 // bars the centre of the 5-bar fractal must beat, keep at 4 breakoutBars = 2 // bars for the breakout high / low atrPeriod = 7 // ATR length for the entry buffer atrMultiplier = 0.3 // entry buffer beyond the breakout level, in ATRs bandPeriod = 34 // length of the log-price exponential bands seedPeriod = 3 // SMA used to seed the bands on early bars bandWidth = 1.618 // band width in standard deviations rsiPeriod = 2 // RSI length for the exit overboughtLevel = 85 // long exit needs RSI at or above this oversoldLevel = 15 // short exit needs RSI at or below this lookbackPeriod = 100 // window for the prior swing high / low // State, seeded so every value is defined on the first bar. ONCE fractalHighCount = 0 ONCE fractalLowCount = 0 ONCE trendBreak = 0 ONCE bearSetup = 0 ONCE bullSetup = 0 ONCE fractalHigh = 0 ONCE fractalLow = 0 ONCE fractalBar = 0 ONCE trendHeight = 0 ONCE closeHeight = 0 ONCE maxAngle = 0 ONCE logEma = 0 ONCE logVariance = 0 ONCE longExitArmed = 0 ONCE shortExitArmed = 0 // --- Indicators --- // Count how many of the last five bars the bar two back beats. FOR i = 0 TO fractalBars DO IF high[2] > high[i] THEN fractalHighCount = fractalHighCount + 1 ENDIF IF low[2] < low[i] THEN fractalLowCount = fractalLowCount + 1 ENDIF NEXT // A fractal high starts a bearish trend line, a fractal low a bullish one. IF fractalHighCount = fractalBars THEN IF bearSetup = 0 AND bullSetup = 0 THEN bearSetup = 1 ENDIF fractalHigh = high[2] fractalBar = BarIndex - 2 ENDIF IF fractalLowCount = fractalBars THEN IF bearSetup = 0 AND bullSetup = 0 THEN bullSetup = 1 ENDIF fractalLow = low[2] fractalBar = BarIndex - 2 ENDIF fractalHighCount = 0 fractalLowCount = 0 IF bearSetup = 1 THEN trendHeight = fractalHigh - high closeHeight = fractalHigh - close ELSIF bullSetup = 1 THEN trendHeight = low - fractalLow closeHeight = close - fractalLow ENDIF // Track the steepest angle of the trend line from the fractal, then detect // a two-step break of that line (trendBreak 1, then 2). IF BarIndex - 2 = fractalBar THEN maxAngle = Tan(2 / trendHeight) ENDIF IF BarIndex - 2 > fractalBar THEN IF bearSetup = 1 THEN IF Tan((BarIndex - fractalBar) / trendHeight) > maxAngle AND (close < open OR close < close[1]) THEN maxAngle = Tan((BarIndex - fractalBar) / trendHeight) trendBreak = 0 ENDIF IF trendBreak = 0 AND Tan((BarIndex - fractalBar) / closeHeight) > maxAngle AND close > open THEN trendBreak = 1 ELSIF trendBreak = 1 AND Tan(((BarIndex - 1) - fractalBar) / closeHeight) > maxAngle AND close > close[1] THEN trendBreak = 2 ENDIF ELSIF bullSetup = 1 THEN IF Tan((BarIndex - fractalBar) / trendHeight) > maxAngle AND (close > open OR close > close[1]) THEN maxAngle = Tan((BarIndex - fractalBar) / trendHeight) trendBreak = 0 ENDIF IF trendBreak = 0 AND Tan((BarIndex - fractalBar) / closeHeight) > maxAngle AND close < open THEN trendBreak = 1 ELSIF trendBreak = 1 AND Tan(((BarIndex - 1) - fractalBar) / closeHeight) > maxAngle AND close < close[1] THEN trendBreak = 2 ENDIF ENDIF ENDIF atrValue = AverageTrueRange[atrPeriod](close)
67 weitere Zeilen: die Einstiegs- und Ausstiegsregeln.
Setup
Fragen
Ja, Einstiege sind schwebende Stop-Orders, die für einen Bar gültig sind. Der Code wurde neu geschrieben, aber nicht auf Kompilierfehler geprüft, und die Statistik stammt aus der früheren Version.
Alle sieben Zeilen waren profitabel. USD/JPY Täglich erzielte JPY 754,540 über 300 Trades, und Nikkei 225 Täglich erzielte USD 20,201.20.
Mit 1 Kontrakt hatte der beste Durchlauf einen max Drawdown von JPY 93,910. Gold Täglich war mit EUR 317.10 viel kleiner.
Trendlinien, die aus Fraktalen gezeichnet werden, brauchen genügend bars zwischen den swing-Punkten. Jede getestete Zeile nutzte 4-Stunden- oder Tages-bars.
Verwandt
Die ProRealAlgos Community erhält die vollständigen Regeln, den kompletten Code und das automatisierte Portfolio.