OBV

定义

public static IEnumerable<ObvResult> GetObv<TQuote>(this IEnumerable<TQuote> quotes, int? smaPeriods = null) where TQuote : IQuote

描述

OBV(On-Balance Volume) 由 Joe Granville 创立,是一个将成交量与价格变动相结合的动量指标。它通过累积成交量来预测价格趋势的变化。

参数

参数名 类型 描述
smaPeriods Int

返回值

返回值 类型 描述
Date DateTime 日期
ObvSma double OBV的移动平均
Obv double 能量潮值

示例

///指标数据
QuoteHistoryDay(10, (dic) =>
{
    if (dic.Count > 0)
    {
        foreach (var item in dic.Keys)
        {
            ///获取指标结果
            var resp = dic[item].GetObv(14);
            Console.WriteLine(resp.ToJson());
        }
    }

});