Salve, come posso fare per limitare il numero massimo di ordini giornalieri? (utilizzando timeframe a 1H)
DEFPARAM CUMULATEORDERS = False
defparam flatbefore = 090000
defparam flatafter = 173000
//c1 = average [22]
c3 = CALL adattiva[5, 2, 26]
//c2 = average [9]
if average [3] < c3 then
buy 1 lot at market
endif
if average[3] > c3 then
sellshort 1 lot at market
endif
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 >=
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: