KDJ

定义

public static IEnumerable<StochResult> GetStoch<TQuote>(this IEnumerable<TQuote> quotes, int lookbackPeriods = 14, int signalPeriods = 3, int smoothPeriods = 3) where TQuote : IQuote

描述

KDJ 指标,也称为随机振荡指标(Stochastic Oscillator),由 George Lane 创立。它是一个动量指标,通过比较收盘价与一定时间周期内的价格范围,来判断市场的超买超卖状态和趋势转折点。

参数

参数名 类型 描述
lookbackPeriods Int 回顾周期
signalPeriods Int 信号周期(M1)
smoothPeriods Int 平滑周期(M2)

返回值

返回值 类型 描述
Date DateTime 日期
Oscillator decimal K值
PercentJ decimal J值
Signal decimal D值

示例

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

 });