Needs code for Expansion Breakout - please help me in generating below alog code, this is taken from hit and run trading book

BUY:

  1. Today (day one) must be 2month calendar high (new high based on range expansion, not on ADX OR RSI)

  2. Today range (high -low) must be equal to or larger than the largest daily range of previous nine days.

  3. Buy only if tomorrow high is 1/8 points of today high .

SELL:

  1. Today (day one) must be 2month calendar low

  2. Today range must be equal to or larger than the largest daily range of previous nine days.

  3. short only if tomorrow low is 1/8 points of today low.

As per the above condition

Buy Script:

SET A = HHV(21)
SET B = HIGH-LOW
REF(CLOSE,2)>REF(CLOSE,1) AND
REF(CLOSE,1)>A AND REF(CLOSE,1)>B

Sell Script:

SET A = LLV(21)
SET B = HIGH-LOW
REF(CLOSE,2)<REF(CLOSE,1) AND
REF(CLOSE,1)<A AND REF(CLOSE,1)<B

Please explain in brief, tomarrows high is 8 points of today… how can we define tomarrows…?

Thanks for helping me through. Here i explain
candle 1 - day one ( 2month calendar high ) and
(High - low) must be equal to or larger than the largest daily range of previous nine day
candle -2 , day two (Buy signal should trigger if trading price crosses 0.005 times of yesterday high)
Eg: ABC stock trades open at 95
day 1; reached its high 98 ( which made 2 month calendar high and largest of previous nine days)
day 2: buy signal should trigger @ 98.49 ~ 98.5 (0.005 times of yesterday high)
hope this helps.