Buongiorno a tutti, stavo provando il codice che trova l’higher high e higher low giornaliero in intraday utilizzando gli esempi in documentation.
https://www.prorealcode.com/documentation/category/constants/
Ma se per il Newhighest trova correttamente il massimo, per il Newlowest da sempre valore 0.
Volevo segnalare questo errore e chiedere se si può correggere.
grazie
Massimo
//Looking the highest high of the last 10 bars
Newhighest=0
FOR a = 0 TO 10 DO
IF DHigh(a)>Newhighest THEN
Newhighest = DHigh(a)
ENDIF
NEXT
RETURN Newhighest
//Looking the lowest low of the last 10 bars
Newlowest=0
FOR a = 0 TO 10 DO
IF DLow(a)<Newlowest THEN
Newlowest = DLow(a)
ENDIF
NEXT
RETURN Newlowest
Grazie per averlo indicato, è davvero un errore stupido, il prezzo non può mai essere inferiore a 0 e quindi il valore del minimo sarà sempre uguale a 0. Qui è il codice corretto:
//Looking the lowest low of the last 10 bars
Newlowest=0
FOR a = 0 TO 10 DO
IF DLow(a)<Newlowest or Newlowest=0 THEN
Newlowest = DLow(a)
ENDIF
NEXT
RETURN Newlowest