Ciao Max, approfitto della tua disponibilità e pazienza x chiederti se ed eventualmente come migliorare la velocità delle ottimizzazioni perchè impiega tantissimo tempo per portare a termine anche le piu' semplici, in questo screen per sole 25 ottimizzazioni ho atteso quasi 10 minuti....!!!
Questo è il codice che stò utilizzando, forse ho creato qualche loop o cose strane?
BUY SCRIPT
INPUTS: @price(CLOSE), @periods(250), @IDA(2), @IDB(1), @ZsLow(2), @ZsHigh(3)
SET ZsTotal = ZScore(GetGlobalVar(@IDA) - GetGlobalVar(@IDB), @periods)
# Primo Buy
SET CrossUP1 = CROSSOVER(ZsTotal,-@ZsLow)
SET ContCrossUP1 = LASTIF(CrossUP1)
SET BUY1 = ContCrossUP1 = 1
# Secondo Buy
SET CrossUP2 = CROSSOVER(ZsTotal,-@ZsHigh)
SET ContCrossUP2 = LASTIF(CrossUP2)
SET BUY2 = ContCrossUP2 = 1
(CurrentContracts() <= 0 AND BUY1) OR (CurrentContracts() > 0 AND BUY2)
EXIT BUY
SET ZsTotal = ZScore(GetGlobalVar(@IDA) - GetGlobalVar(@IDB), @periods)
ZsTotal > 0
Idem x sell