Every Amibroker AFL starts with a section. A section is nothing but a block, that contains your AFL codes. Syntax of your AFL section is like this
_SECTION_BEGIN(“Name of the section”);
// Your Code
_SECTION_END();
You can use any name your like to identify your section purpose.
Comment Line in AFL code starts with “//”. If you wish to make comment of your logic or code purpose then put a “//” before that line.
Use /* ……. */ as block commnet. It will make multple lines comment.
Sample
//This is a comment line
/* This is start of our comment
second line of comment
third line
.
.
.
End of my comments */
You may have seen many hefty block of codes of AFL. But What is the main purpose of AFl code? We wants to generate Buy or sell signals from them. So every AFL has 4 main parts
Buy = Your entry signal for long trade;
Sell = You exit signal for long trade;
Short = Your entry signal for short trade;
Cover = You exit signal for short trade;
Well now traders have their own trading plans for different Buy or sell signals. So now decide your signal and put in here.
Now take an example
//Buy Logic AFL
Buy= Cross(EMA( C, 20 ), EMA( C, 50 ));
//Sell logic for AFL
Sell= Cross(EMA( C, 50 ), EMA( C, 20 ));
_SECTION_END();
Mobile: (+91)-9038787021
Email: debarghya_mkr@yahoo.com