…ovvimente i due come del comando return sono da intendere as.
Scusate.
Questo stampa i dati solo dalle 10 alle 18, però vedi sempre lo scalino:
if time<090000 then
sup=high
inf=low
elsif time>=090000 and time<=100000 then
sup=max(high,sup)
inf=min(low,inf)
delta=(sup-inf)
else
HE=sup
LE=inf
endif
t = 0
IF Time >= 100000 AND Time <= 180000 THEN
t = 255
ENDIF
return HE as "H-Edge" coloured("Blue",t), LE as "L-Edge" coloured("Red",t)
perché con RETURN non si può evitare.
Questa versione usa, invece, i comandi grafici, quindi lo scalino NON si vede:
once Barra = 0
ONCE Inizio = 0
if time<090000 then
sup=high
inf=low
elsif time>=090000 and time<=100000 then
Barra = Barindex
IF Barra <> Barra[1] THEN
Inizio = Barra
ENDIF
sup=max(high,sup)
inf=min(low,inf)
delta=(sup-inf)
else
HE=sup
LE=inf
endif
IF Time > 100000 AND Time <= 180000 THEN
DrawSegment(Inizio,HE,BarIndex,HE) coloured("Blue",255) style(line,2)
DrawSegment(Inizio,LE,BarIndex,LE) coloured("Red",255) style(line,2)
ENDIF
return