Easy financial chart - Write you own formulas

Easy financial chart provide a flexible way to embed your own formulas. You can bundle all you formulas to a dll file, put it to the plugins subfolder, then it will be loaded automatically when main program start.

Here I make a file called demo.fml in \Program Files\Easy Financial Chart\WindowsDemo\bin\debug\plugins folder , it's the source code of plugin dll . Open it using formula editor. (figure 1)

figure 1

Expand the left tree to find the MACD formula.(figure 2)

figure 2

There are three parameters in this formula, LONG,SHORT and M. These parameters are referenced by the formula program.
In the code text box shows following formula:
DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA : EMA(DIFF,M);
MACD : 2*(DIFF-DEA), COLORSTICK;

This means the formula will show three lines on the chart : DIFF,DEA and MACD.

Let's see the first line : DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
This line means that the exponental moving average of the last "LONG" days closes will be subtracted from the exponental moving average of the last "SHORT" days closes. The LONG and SHORT was specified in the parameter area(Figure 3).

The second line means that the exponental moving average of the last "M" days of DIFF. DIFF is the value returned by the first line.

The third line means that first line subtract the second line , the result multiply by 2. and show this line in a style of COLORSTICK.
Figure 3

Let's open WindowsDemo.exe , You can see how the MACD formula is drawn in the chart.(Figure 4)
Figure 4

Modify the MACD formula , and see what happens.
Add two lines in the code text box :
0.25;
TRIMA:MA(DEA,M2);

Press F9 to compile it. The editor shows an error "The name M2 does not exist". This is because we did not define this parameter. (Figure 5)
Figure 5

Right click MACD in the tree, add the parameter M2.(Figure 6)

Figure 6

Press F9 to Compile.
If the WindowsDemo.exe still open, Formula editor will give an error : "Could not write to output file..."(figure 7)
so make sure to close the WindowsDemo.exe before compile.

Figure 7

Press F9 again.
This time we get the OK! message in the editor.(figure 8)

Figure 8

Open WindowsDemo.exe again. You will see two extra lines shown in the chart.(figure 9)

Figure 9

You can double click the formula area to change the formula parameters.(figure 10)

Figure 10

Define which formulas can be selected in the chart at App.config.
<add key="SupportedFormulas" value="VOLMA;EXTEND.RSI;DEMO.MACD;CCI;DEMO.FUNC1;DEMO.FUNC2;DEMO.FUNC3" />
each formula is seperated by semicolon.


Quick Formula Script Language Guide

Any questions? feel free to contact me!
http://finance.easychart.net