I want to modify below code

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

I want to modify above code only if below condition fulfilled 

Condition 1 : If  SET A Line  > SET B Line and SET A Line Previous < SET B Line and SET A Line > SET C Line then "BUY"

Condition 2 : If  SET A Line  < SET B Line and SET A Line Previous > SET B Line and SET A Line < SET C Line then "SELL"

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

A > B AND REF(CLOSE,A) < B AND A > CLOSE

Sell Script:

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

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

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

A < B AND REF(CLOSE,A) > B AND A < C

hi,
Following error coming while testing above code if i checked more than 10 Min time frame
1.Your script generated an error ,script generated no trades
2. No results .make sure that at least Buy and Sell scripts are typed in.
please suggest ASAP

try with more historical data