Help needed for buying or selling near ATR

Hello,

I am a complete newbie here and using amibroker charting manually to do trading. Recently i have started doing some experiments in algo and now trying to see if i can able to automate one of my ideas.

I use 2*ATR(14) as my trailing stoploss. All i need to do is i need to buy when price is almost near to this stoploss line. Any ideas on how to do thisque ?

your_line = /*your line array*/;

percent = 0.5;// approach range in %

is_almost_there = AlmostEqual(L, your_line, percent*1e5) AND L > your_line;

Buy = is_almost_there;
6 Likes

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.