What is wrong with following Code giving error

wanted to track stock price falling between buy conditiondefined

SET DayH = REF(HIGH,1)
SET DayL = REF(LOW,1)
SET DayC = REF(CLOSE,1)

SET Range = (DayH-DayL)

SET HH5 = DayC + Range *0.75
SET HH4 = DayC + Range *0.50
SET HH3 = DayC + Range *0.25

((CLOSE>HH3 AND CLOSE<HH3) OR (CLOSE>HH4 AND CLOSE<HH5) ) // Buy conditions

1 Like

As per your condition  

Buy Script:

SET A = REF(CLOSE,1)+ TR() * 0.75
SET B = REF(CLOSE,1)+ TR() * 0.50
SET C = REF(CLOSE,1)+ TR() * 0.25
(CLOSE>C AND CLOSE<C) OR
(CLOSE>B AND CLOSE<B) OR
(CLOSE>A AND CLOSE<A)

Are you using in tradescript or amibroker afl?

Syntax error in both AFL and Tradescript

Trade script I just want to scan prices held between defined fibo levels please give me sample code

Thanks for your reply, i am following questions
is REF(ClOSE,1) represents previous bar close or previous day close, if it is previous bar close, i need code previous day close
what is TR () function represents in above code, so that i can use later?
Next to SET do we need use only one letter (A) or (B) or ©, can’t i use more than one letter like SET High