2017년 8월 31일 목요일

Developing ElliottBrowser for Quandl.Com - 4


Applying Elliott Wave Analysis to a Chart


    Readers may have been heard of the Elliott Wave Principle. The purpose of this post is not to talk about the principle itself or some controversial topics about it, but to introduce two technical analysis tools based on the methods described in 'Mastering Elliott Wave', a Glenn Neely's book.

    Let's proceed directly with the tools. The two differ in how they define mono-waves. Of course, according to the book, there is only one way to define them, and one of the tools adopts it. The other tool uses the concept of 'fractals' in the book 'Trading Chaos' by Bill Williams, and it considers a mono-wave as a wave between a fractal and its adjacent opposite fractal.

    In terms of ElliottBrowser, they are technical indicators TiESPN (Technical indicator for Elliott wave Structure & Progress Notation) and TiESPNfr, respectively, and both analyze given chart data to produce SP (Structure & Progress) notations of each mono-wave in the chart. And both include the Elliott oscillator, i.e., MACD(5, 34, 5) as an auxiliary indicator. See Fig 1 and 2.


Fig 1. ESPN, Alphabet Inc. 2017.08.28


Fig 2. ESPNfr, Alphabet Inc. 2017.08.28


    This post will not treat the details on how TiESPN and TiESPNfr work, but will cover briefly how to use them, Instead. Actually, they are classes included in the library WnFTechnicalIndicators.dll, and which in turn uses WnFElliottWave.dll, the Elliott wave analysis library of Wave And Fractals Co., Ltd.


▷ Some Technical Specifics


    There are 3 ways to apply Elliott wave analysis to a chart data, and it's enough to use one of them.

    1. Using TiESPN or TiESPNfr

using WnFTechnicalIndicators;

    ...
    Chart ch;
    WnFTechnicalIndicators.TI ti;
    ...
    WnFCandles candles = WnFElliottBrowser.Factory.GetCandles(_symbol, _period, CommodityType.None);
    TechnicalIndicator indicator;

    if (ti == TI.ESPN)
    {
        indicator = new TiESPN();
    }
    else if (ti == TI.ESPNfr)
    {
        indicator = new TiESPNfr(new int[]{ 5 });
    }
    
    indicator.Init(candles.DOHLCV);
    ch.DataSource = indicator.Data;


 
    2. Using 'IndicatorSignal' instance

    Along with several technical indicator classes, the library contains the 'IndicatorSignal' class, the usage of which is to raise events (or notification) in real-time environment based on the conditions of its companion technical indicator.

    This method is more general so that we can apply technical indicators, other than TiESPN or TiESPNfr, to a chart.

    Chart ch;
    WnFTechnicalIndicators.TI ti;
    ...
    WnFCandles candles = WnFElliottBrowser.Factory.GetCandles(_symbol, _period, CommodityType.None);
    ...
    string sstr = IndicatorSignal.GetDefaultSigStr(ti, (CandlePeriod)_period);
    IndicatorSignal isig = new IndicatorSignal((CandlePeriod)_period, sstr, ti);
    // Setting a companion technical indicator of the IndicatorSignal instance
    isig.Indicator = IndicatorSignal.IStrToObj(isig.TI, isig.IStr);
    isig.Indicator.Init(candles.DOHLCV);
    ch.DataSource = isig.Indicator.Data;


 
    3. Using WnFElliottWave.dll directly

    WnFElliottWave.dll library contains 2 classes, ElliottWave and MacroWave. ElliottWave corresponds to a mono-wave, and MacroWave represents a collection of linked mono-waves.

    Given a line chart, a MacroWave instance finds mono-waves and analyzes them based on the methods described in the Glenn Neely's book 'Mastering Elliott Wave'.

using WnFElliottWave;

    ...
    Chart ch;
    WnFCandles candles = WnFElliottBrowser.Factory.GetCandles(_symbol, _period, CommodityType.None);
    
    candles.DOHLCV.Columns.Add("ESPN", typeof(double), "(High+Low)/2");   // Mean Price
    candles.DOHLCV.Columns.Add("ESPN_SP", typeof(string));                // SP notations

    MacroWave eph = new MacroWave();
    eph.mplist = candles.DOHLCV.AsEnumerable().Select(r => r.Field("ESPN")).ToArray();
    eph.monoize();
    eph.analyze(WnFElliottWave.EPAM.DE);
    
    foreach (ElliottWave li in eph.mw_list.Values)
    {
        candles.DOHLCV.Rows[li.liS]["ESPN_SP"] = li.mSP;
    }
    
    ch.DataSource = candles.DOHLCV;


    There are 3 modes of analysis, which are typed to the enum WnFElliottWave.EPAM. See below.

namespace WnFElliottWave
{
    [Guid("F021AB8E-F16D-4EB0-A268-8C26A8E6C812"), ComVisible(true)]
    public enum EPAM
    {
        DE = 0,    // Default - Analyzes all mono-waves
        SI = 1,    // Skips very small, i.e., non-similar mono-waves
        DI = 2     // Analyzes directional movements
    }
}



댓글 없음:

댓글 쓰기