Build 4.0.0.88 of xlsgen adds support for the MACD chart.
The MACD chart (short for Moving average convergence divergence) is a trend chart often used for stock trading. It is made of two lines and one bar. Wikipedia
article.
MACD (the input data is in blue, everything else is the MACD)The first line is the signal line and is a two pass filter. Its scale is represented on the secondary Y axis. The second line, the average line, is a low pass filter of the signal line. And finally the bar chart is the difference between the two. Both are attached to the secondary Y axis.
Interpretation for trading :
- A "signal-line crossover" occurs when the MACD and average lines cross; that is, when the bar chart changes sign. The standard interpretation of such an event is a recommendation to buy if the MACD line crosses up through the average line (a "bullish" crossover), or to sell if it crosses down through the average line (a "bearish" crossover). These events are taken as indications that the trend in the stock is about to accelerate in the direction of the crossover.
- A "zero crossover" event occurs when the MACD series changes sign, that is, the MACD line crosses the horizontal zero axis. This happens when there is no difference between the fast and slow EMAs of the price series. A change from positive to negative MACD is interpreted as "bearish", and from negative to positive as "bullish". Zero crossovers provide evidence of a change in the direction of a trend but less confirmation of its momentum than a signal line crossover.
C/C++ code |
xlsgen::IXlsWorkbookPtr wbk = engine->Open( L"EURUSD1.csv", L"output.xls" );
xlsgen::IXlsChartPtr chart1 = wbk->WorksheetByIndex[1]->NewChart(xlsgen::charttype_macd, row1, col1, row2, col2); xlsgen::IXlsChartDynamicDataSourceSeriesPtr serie1 = chart1->DynamicDataSource->AddSerie(); serie1->SeriesValuesFormula = L"=R1C3:R100C3";
|