Citazione Originariamente Scritto da Smash Visualizza Messaggio
Ciao Planta,

per prima cosa il Buy Script mi piacerebbe di più scritto in questa forma, equivalente alla tua ma forse a mio avviso un po' più intuitiva:

Buy Script

SET a = HML()
SET b = HIGH < REF(HIGH, 1)
SET c = LOW > REF(LOW, 1)
SET PatternIDNR4 = a < REF(a, 1) AND a < REF(a, 2) AND a < REF(a, 3) AND b AND c

REF(PatternIDNR4, 1) AND HIGH > REF(HIGH, 1)

Il Sell Script invece:

SET a = HML()
SET b = HIGH < REF(HIGH, 1)
SET c = LOW > REF(LOW, 1)
SET PatternIDNR4 = a < REF(a, 1) AND a < REF(a, 2) AND a < REF(a, 3) AND b AND c

REF(PatternIDNR4, 1) AND LOW < REF(LOW, 1)

Poi metterei gli Exit Long e Short in questa maniera:


Exit Long Script

SET a = HML()
SET b = HIGH < REF(HIGH, 1)
SET c = LOW > REF(LOW, 1)
SET PatternIDNR4 = a < REF(a, 1) AND a < REF(a, 2) AND a < REF(a, 3) AND b AND c
SET StopLONG = CHANGEIF(PatternIDNR4, LOW)

LOW < StopLONG

Exit Short Script

SET a = HML()
SET b = HIGH < REF(HIGH, 1)
SET c = LOW > REF(LOW, 1)
SET PatternIDNR4 = a < REF(a, 1) AND a < REF(a, 2) AND a < REF(a, 3) AND b AND c
SET StopSHORT = CHANGEIF(PatternIDNR4, HIGH)

HIGH > StopSHORT

Ti prego di verificare se è corretto!

Poi chiaramente mancherebbero l'uscita in take profit e l'uscita temporale.
perfetto Smash è quello che volevo il pattern come lo hai scritto tu ė giusto, entra a rottura di Max o min della barra inside e mette stop giusto. Ora metto trailing stop e filtro temporale ed ė pronto x backtest. Speriamo funzioni
grazie ancora
ciao