Alıntı Originally Posted by Caglar Yazıyı Oku
Sn Keçi konusu açıldı ve kimseyi yanlış yönlendirmeyelim diye birkaç siteye bakıp doğrusunu bulmaya çalıştım. Daha önceden formulünü okuduğum Investopedia hatalı görünüyor. Diğerlerinin hepsinde formul aşağıdaki gibi:

HTML Kod:
1. The Heikin-Ashi Close is simply an average of the open, 
high, low and close for the current period. 

HA-Close = (Open(0) + High(0) + Low(0) + Close(0)) / 4

2. The Heikin-Ashi Open is the average of the prior Heikin-Ashi 
candlestick open plus the close of the prior Heikin-Ashi candlestick. 

HA-Open = (HA-Open(-1) + HA-Close(-1)) / 2 

3. The Heikin-Ashi High is the maximum of three data points: 
the current period's high, the current Heikin-Ashi 
candlestick open or the current Heikin-Ashi candlestick close. 

HA-High = Maximum of the High(0), HA-Open(0) or HA-Close(0) 

4. The Heikin-Ashi low is the minimum of three data points: 
the current period's low, the current Heikin-Ashi 
candlestick open or the current Heikin-Ashi candlestick close.

HA-Low = Minimum of the Low(0), HA-Open(0) or HA-Close(0)
Kaynaklar:
http://stockcharts.com/school/doku.p...is:heikin_ashi
https://www.mql5.com/en/forum/175407
http://forexop.com/candlesticks/heikin-ashi-system/

Bu arada kendi kodumu da güncelledim.

Kod:
public List<cxBar> HeikinAshi(List<cxBar> bars)
{
    var ha = bars.Select(b => b.Clone()).ToList();

    try
    {
        for (int i = 1; i < bars.Count; i++)
        {
            ha[i].Close = (bars[i].Open + bars[i].High + bars[i].Low + bars[i].Close) / 4;
            ha[i].Open = (ha[i - 1].Open + ha[i - 1].Close) / 2;
            ha[i].High = Max(bars[i].High, ha[i].Open, ha[i].Close);
            ha[i].Low = Min(bars[i].Low, ha[i].Open, ha[i].Close);
        }
    }
    catch (Exception ex)
    {
        //Log(string.Format("ToHeikinAshi failed. Ex: {0}", ex));
    }

    return ha;
}
Bu kodu derleyebilmek için User.dll'e Max ve Min metodlarının da eklenmesi gerektiğini farketttim:

Kod:
public T Max<T>(params T[] args)
{
    return args.Max();
}

public T Min<T>(params T[] args)
{
    return args.Min();
}
İhtyacı olan arkadaşlar faydalanabilirler diye düşünüyorum.
anladım. son durumda ideal hesaplaması yine hatalı, öyle değil mi?