Friday, December 9, 2011

AFL Code Writing : Lesson 2 (Part 2)

Today I will describe the line no. 2 of the below code :
Before explain the the above code, I would like to take more easy code. I already described the Line 1 and Line 3 in our previous lesson. So, I have omitted the Line 1 and Line 3. I'll describe the Line 2 by a non Programming way so that you can understand the code easily. I've no intension to make you mad at the beginning by describing the FUNCTION / PARAMETERS / ARGUMENTS / ARRAY. Okay, pls. look at the below code :

Syntax : Plot( Close, "Close", colorGold, styleCandle);
We have used Plot ( .......) to display the chart.


Syntax : Plot(Close, "Close", colorGold, styleCandle);
We have used Close, "Close", . 1st Close has been used to take the price and 2nd "Close" is the name of the 1st  Close. You may keep it blank or empty like  "  " or give a new name like  "It will take price"

Syntax : Plot(Close, "Close", colorGold, styleCandle);
We have used colorGold to color the price that has been displayed by Candle Sticks. Pls. see the below:

Syntax : Plot(Close, "Close", colorGold, styleCandle);
We have used styleCandle to display our price through Candle Sticks.

If you don't understand the line 2 yet, no problem pls see the below revision:

Syntax : Plot(Close, "Close", colorGold, styleCandle;
Plot will display the chart.
What chart will be displayed? Price Chart. Close will gives the data of the price that will be displayed through styleCandle. 
What will be the color of the price chart? colorGold will give a gold color.

If you don't understand yet, no problem just copy the below code and paste it in your Formula Editor :

_SECTION_BEGIN("Price");
Plot( Close, "Close", colorGold, styleCandle);
_SECTION_END();


Now, your job is
=> write styleBar instead of styleCandle and see the effect.
=> write colorAqua instead of colorGold and see the effect.
=> write Open, "Open" instead of  Close, "Close" and see the effect.

2 comments: