DEFPARAM DrawOnLastBarOnly = True
//
// GetTimeFrame
//
// restituisce:
// 1 = 1 second
// 10 = 10 seconds
// 60 = 1 minute
// 300 = 5 minutes
// 3600 = 1 hour
// 14400 = 4 hours
// 86400 = 1 day (24 hours)
// 172800 = 2 days (48 hours)
// 604800 = 1 week (7 days)
// 2592000 = 1 month (30 days)
// 31536000 = 1 year (365 days)
// -1 = default TF (or non time based TF)
//
ONCE Futuro = 2 //stampa per 2 barre future
ONCE PrevHH = 0
ONCE PrevLL = 0
ONCE HH = 0
ONCE LL = 0
TF = GetTimeFrame
IF TF >= 86400 THEN
PrevHH = HH
PrevLL = LL
HH = high
LL = low
Barra = BarIndex
ELSIF IntraDayBarIndex = 0 THEN
PrevHH = HH
PrevLL = LL
HH = high
LL = low
Barra = BarIndex
ENDIF
HH = max(HH,high)
LL = min(LL,low)
DrawSegment(Barra,PrevHH,BarIndex + Futuro,PrevHH) coloured(0,0,255,255) style(line,2)
DrawSegment(Barra,PrevLL,BarIndex + Futuro,PrevLL) coloured(255,0,0,255) style(line,2)
RETURN