Devi usare un contatore, che ad ogni inizio giornata rimetti a 0.
Ogni volta che viene eseguito un BUY o un SELLSHORT aggiungi 1.
Alle tue condizioni aggiungi che il contatore non sia >=
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
DEFPARAM CUMULATEORDERS = False defparam flatbefore = 090000 defparam flatafter = 173000 ONCE Contatore = 0 IF IntraDayBarIndex = 0 THEN Contatore = 0 ENDIF //c1 = average [22] c3 = CALL adattiva[5, 2, 26] //c2 = average [9] if average [3] < c3 AND Contatore < 3 AND Not OnMarket then buy 1 lot at market Contatore = Contatore + 1 endif if average[3] > c3 AND Contatore < 3 AND Not OnMarket then sellshort 1 lot at market Contatore = Contatore + 1 endif |
3 e che non sia già a mercato: