L'ADX(14) decide la modalità. Nei mercati tranquilli il sistema compra dopo una grande candela discendente e va short dopo una grande candela ascendente, e quando l'ADX è alto segue invece la candela. I long chiudono 30 bar dopo l'ultima operazione e gli short dopo 5 bar.
Migliore esecuzione su 4. FTSE 100, 4 ore, spread 2, dall'esecuzione pf:2026-09-24-FTSE100-4h.tsv:2.
| Periodo | Fino al 2026-09-25 |
| Strumento | FTSE 100, 4 ore |
| Spread | 2 punti |
| Contratti | 1 |
| Capitale iniziale | 1,000,000 |
| Costi | Solo spread. Commissioni e finanziamento overnight non sono inclusi. |
| Barre | Fino a 200,000 barre, meno dove lo strumento ha meno storico |
| Ultimo test | 2026-09-25 |
| positionSize Contratti per operazione | 1 |
| atrPeriod Lunghezza ATR per la dimensione della candela e il limite di volatilità | 14 |
| adxPeriod Lunghezza ADX per il cambio di regime | 14 |
| adxLongThreshold Long: ADX sopra = regime breakout, sotto = mean reversion | 36 |
| adxShortThreshold Short: ADX sopra = regime breakout, sotto = mean reversion | 24 |
| atrMaxLong Nessun long quando l'ATR è pari o superiore a questo valore | 100 |
| atrMaxShort Nessuno short quando l'ATR è pari o superiore a questo valore | 200 |
| longReversionMultiplier Long dopo una candela discendente maggiore di questo numero di ATR | 1 |
| longBreakoutMultiplier Long dopo una candela ascendente maggiore di questo numero di ATR | 1 |
| shortReversionMultiplier Short dopo una candela ascendente maggiore di questo numero di ATR | 1 |
| shortBreakoutMultiplier Short dopo una candela discendente maggiore di questo numero di ATR | 2 |
| maxBarsLong Chiudi un long dopo questo numero di bar | 30 |
| maxBarsShort Chiudi uno short dopo questo numero di bar | 5 |
| midMonthDay I giorni fino a questo valore contano come prima metà del mese | 15 |
| janFirstHalf Peso stagionale, prima metà di gennaio (zero blocca nuovi long) | 3 |
| janSecondHalf Peso stagionale, seconda metà di gennaio (zero blocca nuovi long) | 0 |
| febFirstHalf Peso stagionale, prima metà di febbraio (zero blocca nuovi long) | 3 |
| febSecondHalf Peso stagionale, seconda metà di febbraio (zero blocca nuovi long) | 3 |
| marFirstHalf Peso stagionale, prima metà di marzo (zero blocca nuovi long) | 3 |
| marSecondHalf Peso stagionale, seconda metà di marzo (zero blocca nuovi long) | 2 |
| aprFirstHalf Peso stagionale, prima metà di aprile (zero blocca nuovi long) | 3 |
| aprSecondHalf Peso stagionale, seconda metà di aprile (zero blocca nuovi long) | 3 |
| mayFirstHalf Peso stagionale, prima metà di maggio (zero blocca nuovi long) | 1 |
| maySecondHalf Peso stagionale, seconda metà di maggio (zero blocca nuovi long) | 1 |
| junFirstHalf Peso stagionale, prima metà di giugno (zero blocca nuovi long) | 1 |
| junSecondHalf Peso stagionale, seconda metà di giugno (zero blocca nuovi long) | 2 |
| julFirstHalf Peso stagionale, prima metà di luglio (zero blocca nuovi long) | 3 |
| julSecondHalf Peso stagionale, seconda metà di luglio (zero blocca nuovi long) | 2 |
| augFirstHalf Peso stagionale, prima metà di agosto (zero blocca nuovi long) | 2 |
| augSecondHalf Peso stagionale, seconda metà di agosto (zero blocca nuovi long) | 3 |
| sepFirstHalf Peso stagionale, prima metà di settembre (zero blocca nuovi long) | 3 |
| sepSecondHalf Peso stagionale, seconda metà di settembre (zero blocca nuovi long) | 0 |
| octFirstHalf Peso stagionale, prima metà di ottobre (zero blocca nuovi long) | 3 |
| octSecondHalf Peso stagionale, seconda metà di ottobre (zero blocca nuovi long) | 2 |
| novFirstHalf Peso stagionale, prima metà di novembre (zero blocca nuovi long) | 1 |
| novSecondHalf Peso stagionale, seconda metà di novembre (zero blocca nuovi long) | 3 |
| decFirstHalf Peso stagionale, prima metà di dicembre (zero blocca nuovi long) | 3 |
| decSecondHalf Peso stagionale, seconda metà di dicembre (zero blocca nuovi long) | 2 |
Ogni esecuzione
| Mercato | Timeframe | PF | Operazioni | % successo | Netto | Max DD |
|---|---|---|---|---|---|---|
| FTSE 100Miglior esecuzione | 4 ore | 1.17 | 1,514 | 55.75 | 7,580 EUR | -1,646 |
| DAX 40 | Giornaliero | n/a | 347 | 58.21 | 9,871 EUR | -2,471 |
| GBP/USD | Giornaliero | n/a | 799 | 55.69 | 7,847 USD | -7,788 |
| Nasdaq 100 | Giornaliero | n/a | 585 | 50.77 | 2,959 EUR | -1,721 |
Grafici
Il codice
// ============================================================ // DAX Survivor // ProRealAlgos Strategy Library | prorealalgos.com // Type: Volatility // Direction: Long & short // Timeframe tested: 4 hours // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade atrPeriod = 14 // ATR length for candle size and volatility cap adxPeriod = 14 // ADX length for the regime switch adxLongThreshold = 36 // longs: ADX above = breakout regime, below = mean reversion adxShortThreshold = 24 // shorts: ADX above = breakout regime, below = mean reversion atrMaxLong = 100 // no longs when ATR is at or above this atrMaxShort = 200 // no shorts when ATR is at or above this longReversionMultiplier = 1 // long after a down candle larger than this many ATRs longBreakoutMultiplier = 1 // long after an up candle larger than this many ATRs shortReversionMultiplier = 1 // short after an up candle larger than this many ATRs shortBreakoutMultiplier = 2 // short after a down candle larger than this many ATRs maxBarsLong = 30 // close a long after this many bars maxBarsShort = 5 // close a short after this many bars midMonthDay = 15 // days up to this count as the first half of the month // Seasonal weights per half month. Only zero matters now: zero blocks new longs. janFirstHalf = 3 janSecondHalf = 0 febFirstHalf = 3 febSecondHalf = 3 marFirstHalf = 3 marSecondHalf = 2 aprFirstHalf = 3 aprSecondHalf = 3 mayFirstHalf = 1 maySecondHalf = 1 junFirstHalf = 1 junSecondHalf = 2 julFirstHalf = 3 julSecondHalf = 2 augFirstHalf = 2 augSecondHalf = 3 sepFirstHalf = 3 sepSecondHalf = 0 octFirstHalf = 3 octSecondHalf = 2 novFirstHalf = 1 novSecondHalf = 3 decFirstHalf = 3 decSecondHalf = 2 // --- Indicators --- atrValue = AverageTrueRange[atrPeriod] adxValue = ADX[adxPeriod] candleBody = abs(open - close) longVolatilityOk = atrValue < atrMaxLong shortVolatilityOk = atrValue < atrMaxShort longBreakoutRegime = adxValue > adxLongThreshold longReversionRegime = adxValue < adxLongThreshold shortBreakoutRegime = adxValue > adxShortThreshold shortReversionRegime = adxValue < adxShortThreshold firstHalf = Day <= midMonthDay IF CurrentMonth = 1 THEN IF firstHalf THEN seasonWeight = janFirstHalf ELSE seasonWeight = janSecondHalf ENDIF ELSIF CurrentMonth = 2 THEN IF firstHalf THEN seasonWeight = febFirstHalf ELSE seasonWeight = febSecondHalf ENDIF ELSIF CurrentMonth = 3 THEN IF firstHalf THEN seasonWeight = marFirstHalf ELSE seasonWeight = marSecondHalf ENDIF ELSIF CurrentMonth = 4 THEN IF firstHalf THEN seasonWeight = aprFirstHalf ELSE seasonWeight = aprSecondHalf ENDIF ELSIF CurrentMonth = 5 THEN IF firstHalf THEN seasonWeight = mayFirstHalf ELSE seasonWeight = maySecondHalf ENDIF ELSIF CurrentMonth = 6 THEN IF firstHalf THEN seasonWeight = junFirstHalf ELSE seasonWeight = junSecondHalf ENDIF ELSIF CurrentMonth = 7 THEN IF firstHalf THEN seasonWeight = julFirstHalf ELSE seasonWeight = julSecondHalf ENDIF ELSIF CurrentMonth = 8 THEN IF firstHalf THEN seasonWeight = augFirstHalf ELSE seasonWeight = augSecondHalf ENDIF ELSIF CurrentMonth = 9 THEN IF firstHalf THEN seasonWeight = sepFirstHalf ELSE seasonWeight = sepSecondHalf ENDIF ELSIF CurrentMonth = 10 THEN IF firstHalf THEN seasonWeight = octFirstHalf ELSE seasonWeight = octSecondHalf ENDIF ELSIF CurrentMonth = 11 THEN IF firstHalf THEN seasonWeight = novFirstHalf ELSE seasonWeight = novSecondHalf ENDIF ELSE IF firstHalf THEN seasonWeight = decFirstHalf ELSE seasonWeight = decSecondHalf ENDIF ENDIF // The weight used to scale size; with fixed size a zero weight still means "no long". seasonAllowsLong = seasonWeight <> 0
Altre 35 righe: le regole di ingresso e uscita.
Configurazione
Domande
Sì. Il codice riscritto non è ancora stato verificato in compilazione e le statistiche pubblicate provengono dal codice precedente, quindi testalo in demo prima di andare in live.
FTSE 100 4 ore ha prodotto EUR 7,579.90 su 1,514 operazioni. DAX 40 Giornaliero ha prodotto EUR 9,870.90, GBP/USD Giornaliero USD 7,847.10 e Nasdaq 100 Giornaliero EUR 2,959.40.
Il max drawdown della migliore esecuzione con 1 contratto è stato di EUR 1,645.70. Senza uno stop attivo, mantieni margine aggiuntivo oltre questa cifra.
Periodi di mantenimento di 30 e 5 bar richiedono bar più lente per catturare un vero swing. Tutte le righe testate erano a 4 ore o Giornaliere.
Correlati
La community ProRealAlgos ottiene le regole complete, il codice completo e il portafoglio automatizzato.