1- it is all explained there in regards to Applystop. I have given to you three links. Two of those three link is all you need. So actually all is to be found in the guide and knowledge base. C'mon. Enough with excuses. You have a big roundly formed head on top of your body. That head has quite some content as every other human head, I suppose. Use it.
2- 'for' loop is general case in programming. If you want the author of the program to teach you how to program and about what every bit of possible general code line does mean then he would need to write another thousands of sites of help although there are already books about how to program available. But even for beginners all is available. If you know how to use Excel and how it works then also you already know how to apply AFL. It is not much different. And for further research there are search engines. Help does have search too.
Anyway I have given you
three links and one code example. It's all you need to use to get Applystop drawn.
Also in one of those links there is clearly mentioned
1 - regular exit
2 - max. loss
3 - profit target
4 - trailing
5 - n-bar stop
6 - ruin stop
So general Exit is Sell == 1 or just Sell. This means that in order to draw i.e. SL and TGT shapes you need to use
SL = Sell == 2;
and
TGT = Sell == 3;
and so on.
Instead of just PlotShapes( Sell*shapeSmallDownTriangle,....
This is only needed for plotting.
Pretty clear actually.
Then I have given this link (already shown previously) where there are two examples doing the same thing.
http://www.amibroker.com/kb/2007/03/24/how-to-plot-a-trailing-stop-in-the-price-chart/
Now next thing to do is to adjust some code.
?
Since there is no general Sell for exit (if not wanted) then Sell has to be set to zero because ApplyStop already is an exit procedure that sells at a stop.
Of course you can add regular Sell condition to Applystop too instead of Sell = 0; But if there is only stop exit wanted by the code developer then Sell is just zero. Not sure what's the difficulty.