I want alerts for mentioned Conditions

Dear Sir,
I want alerts for below- mentioned Conditions
First line: (Highest high + lowest low) / 2, calculated over the past seven to eight time periods.
Second line: (Highest high + lowest low) / 2, calculated over the past 22 time periods.
Third line: (Highest high + lowest low) / 2, calculated over the past 44 time periods. Plot 22 periods ahead.
Condition 1(BUY). If Last trading price (LTP) is crossover above value of First line/Second line/Third line then alert should be buy
Condition 2(SELL). If Last trading price (LTP) is crossover below value of first line/second line/Third Value then alert should be sell .

Thanks in advance

As per the above condition

Buy Script:

SET A = (HHV(8)+LLV(8))/2

SET B = (HHV(22)+LLV(22))/2

SET C = (HHV(44)+LLV(44))/2

LAST > A OR LAST > B OR LAST > C

Sell Script:

SET A = (HHV(8)+LLV(8))/2

SET B = (HHV(22)+LLV(22))/2

SET C = (HHV(44)+LLV(44))/2

LAST < A OR LAST < B OR LAST < C

hello Sir,
Why buy and sell signal comes @every candle? Signal should be come If Buy Script:LAST > A OR LAST > B OR LAST > C and Sell Script:LAST < A OR LAST < B OR LAST < C . So is it possible to do that.

Please Reply ASAP…and spread trading is possible in Chart or in trading terminal???