High, Low break Script -Help

I am running the following script

LAST <= REF(HIGH,1) AND LAST <= REF (LOW, 1)
AND
LAST <= REF(HIGH,2) AND LAST <= REF (LOW, 2)
AND
LAST <= REF(HIGH,3) AND LAST <= REF (LOW, 3)

to identify that high and low of 4th candle (15 min) falls within the boundaries of the first candle.

I am getting errors. but as mentioned in Tradescript manual, error description is not being given.
I require help in this regard.

Thanks in advance.
Soma Raju

leave you present candle first

now
REF(HIGH, 1), REF(LOW, 1) first candle
REF(HIGH, 2), REF(LOW, 2) second candle
REF(HIGH, 3), REF(LOW, 3) third candle
REF(HIGH, 4), REF(LOW, 4) fourth candle
let’s code for all three candle with in 4th candle range

      REF(HIGH, 4)> REF(HIGH, 3) AND
      REF(HIGH, 4)> REF(HIGH, 2) AND
      REF(HIGH, 4)> REF(HIGH, 1) AND
      REF(LOW, 4)< REF(LOW, 3) AND
      REF(LOW, 4)< REF(LOW, 2) AND
       REF(LOW, 4)< REF(LOW, 1) AND

now you want to upper breakout
LAST>REF(HIGH, 4)
if you want lower breakout
LAST <REF(LOW, 4)
in if you want both together in alert than use

(LAST>REF(HIGH, 4) OR LAST <REF(LOW, 4))

So full code generating a alert when any range breaks is

      REF(HIGH, 4)> REF(HIGH, 3) AND
      REF(HIGH, 4)> REF(HIGH, 2) AND
      REF(HIGH, 4)> REF(HIGH, 1) AND
      REF(LOW, 4)< REF(LOW, 3) AND
      REF(LOW, 4)< REF(LOW, 2) AND
       REF(LOW, 4)< REF(LOW, 1) AND
       (LAST>REF(HIGH, 4) OR LAST <REF(LOW, 4))   run this code 

and reply its works and not