Wednesday, December 7, 2011

AFL Code Writing : Lesson 2 (Part 1)

Today, we will explain our own written first afl code.

In our AFL Code Writing : Lesson 1, we wrote our first below code :


It's only 3 lines code. First I will describe the line no. 1 and 3 then finally line no. 2. Pls. see the line 1 and 3 below :

Line 1 (begin) described that we have started writing our code and Line 3 (end) described that we have finished our code writing. Between this Begin and End, we will write our code that can be several lines. Pls. see below for example :


Not only you can write multiple line code but also use multiple section i.e. Begin and End in your afl. We usually do it to organize our code. Pls. see the below example :

You have already noticed that we had given different name of each Begin and End. We did it for our own benefit.  It has no any programing value. We can keep it blank/empty or you can give a different name. If you did not understand which point I'm talking about, pls see the below example :

Finally, keep the below points in your mind :

Syntax : _SECTION_BEGIN(" ");
Meaning: We open a section to start our code

Syntax : _SECTION_END();
Meaning : Our section has end i.e. we have finished code writing for this section.

Every complete line you have to finish by a semicolon.

In our AFL Code Writing : Lesson 2 (Part 2), I will discuss the line no. 2 i.e.

Plot( Close, "Close", ParamColor("Color", colorGold ), styleCandle);

3 comments:

  1. Awsum writing brother. Plain n simple to the point. Keep up the good work. And btw onek moja passi pore..onek issa silo coding sikhar, tumr jonno hoye uthbe insAllah aita!

    ReplyDelete
  2. You r indeed a very good teacher..

    ReplyDelete
  3. very simple and best teaching..god bless.. thankyou

    ReplyDelete