Ciao Roberto, mi potresti indicare un codice per disegnare un semplice box tra due orari?
Ho provato uno snippet (n. 287 di Nicolas) ma non so perchè disegna male gli orari.
Ecco il codice:
timec= time>=000000 and time<080000
if timec then
hh=max(hh,high)
ll=min(ll,low)
if hh<>hh[1] then
hhbar=barindex
endif
if ll<>ll[1] then
llbar=barindex
endif
endif
if not timec and timec[1] then
drawrectangle(hhbar,hh,llbar,ll)
drawsegment(hhbar,(hh+ll)/2,llbar,(hh+ll)/2)
//rest
hh=0
ll=close*100
endif
return
e questo è quello che mi disegna sul dax a 15 minuti (gli orari non corrispondono e poi sono sempre differenti). Grazie
Questo funziona:
////DEFPARAM DrawOnLastBarOnly = True
Time1 = 000000
Time2 = 080000
x=0
IF (Time = Time1) OR ((Time > Time1) AND (Time[1] < Time1)) THEN
Bar1 = barindex
hh = high
ll = low
ENDIF
hh = max(hh,high)
ll = min(ll,low)
IF (Time = Time2) OR ((Time > Time2) AND (Time[1] < Time2)) THEN
Bar2 = BarIndex
ENDIF
IF Bar2 > Bar1 THEN
DrawRectangle(Bar1,hh,Bar2,ll) coloured(255,0,0,25) bordercolor(0,255,0,155)
Bar2 = 0
ENDIF
return