How to check price "nearness" to user drawn Support or Resistance ?
In Amibroker AFL, i'd like to check if closing pricing is near a support or resistance. Support and resistance are previously drawn by user and assigned Study Id ="SU" or "RE". So, i try to write Afl code to check if close price is near a "SU"
SU = Study("SU", GetChartID() );
Threshold = SU * 1.02;
Buy = IIf(C > SU && C <= Threshold,1,0) ;
But it seems it not works; no title near Support are signaled!