Buonasera,
chiedo cortesemente aiuto per codificare il seguente codice:
se dalle 143000 alle 16300 si forma un minimo giornaliero
compra quando il mio indicatore diventa long.
e viceversa!
Grazie mille
Max
Ci devi aggiungere il tuo indicatore.
defParam cumulateOrders = false
startHour = 143000
endHour = 163000
cTime = (time >= startHour and time <= endHour)
if openTime = 000000 then
myHighest = high
myLowest = low
endif
if openTime >= 010000 and openTime <=143000 then
myHighest = max (myHighest,high)
myLowest = min (myLowest,low)
endif
//————————————————————-
if not onMarket and cTime and low < myLowest then
buy 1 contract at market
endif
if not onMarket and cTime and high > myHighest then
sellShort 1 contract at market
endif
set stop %loss 1
set target %profit 1
Scusa, devi scrivere alla riga 9 : if openTime >= 000000 and openTime <= 1430000
Se vuoi ricercare il massimo – minimo DA un orario diverso di 000000 devi scrivere il nuovo orario. Esempio, se ricerchi un massimo – minimo dalle 8 di mattina devi sostituire 000000 con 080000.