示例#1
0
文件: TBMACD.cs 项目: zxt1121/hf_at
 /// <summary>
 ///
 /// </summary>
 /// <param name="input"></param>
 /// <param name="period"></param>
 /// <returns></returns>
 public static TBMACD TBMACD(this Indicator indicator, DataSeries input, int fast, int slow, int length)
 {
     if (cacheTBMACD != null)
     {
         for (int idx = 0; idx < cacheTBMACD.Length; idx++)
         {
             if (cacheTBMACD[idx] != null && cacheTBMACD[idx].FastLength == fast && cacheTBMACD[idx].SlowLength == slow && cacheTBMACD[idx].MACDLength == length && cacheTBMACD[idx].EqualsInput(input))
             {
                 return(cacheTBMACD[idx]);
             }
         }
     }
     return(indicator.CacheIndicator(new TBMACD()
     {
         FastLength = fast, SlowLength = slow, MACDLength = length, Input = input
     }, ref cacheTBMACD));
 }
示例#2
0
文件: TBKD.cs 项目: zxt1121/hf_at
 /// <summary>
 ///
 /// </summary>
 /// <param name="input"></param>
 /// <param name="period"></param>
 /// <returns></returns>
 public static TBKD TBKD(this Indicator indicator, DataSeries high, DataSeries low, DataSeries close, int length, int slow, int smooth)
 {
     if (cacheTBKD != null)
     {
         for (int idx = 0; idx < cacheTBKD.Length; idx++)
         {
             if (cacheTBKD[idx] != null && cacheTBKD[idx].Length == length && cacheTBKD[idx].SlowLength == slow && cacheTBKD[idx].SmoothLength == smooth && cacheTBKD[idx].High == high && cacheTBKD[idx].Low == low && cacheTBKD[idx].EqualsInput(close))
             {
                 return(cacheTBKD[idx]);
             }
         }
     }
     return(indicator.CacheIndicator(new TBKD()
     {
         Length = length, SlowLength = slow, SmoothLength = smooth, High = high, Low = low, Input = close
     }, ref cacheTBKD));
 }
示例#3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="input"></param>
 /// <param name="period"></param>
 /// <returns></returns>
 public static TBXaverage TBXAverage(this Indicator indicator, DataSeries input, int period)
 {
     if (cacheXAverage != null)
     {
         for (int idx = 0; idx < cacheXAverage.Length; idx++)
         {
             if (cacheXAverage[idx] != null && cacheXAverage[idx].Period == period && cacheXAverage[idx].EqualsInput(input))
             {
                 return(cacheXAverage[idx]);
             }
         }
     }
     return(indicator.CacheIndicator(new TBXaverage()
     {
         Period = period, Input = input
     }, ref cacheXAverage));
 }
示例#4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="input"></param>
 /// <param name="period"></param>
 /// <returns></returns>
 public static TBSum TBSum(this Indicator indicator, DataSeries input, int period)
 {
     if (cacheTBSum != null)
     {
         for (int idx = 0; idx < cacheTBSum.Length; idx++)
         {
             if (cacheTBSum[idx] != null && cacheTBSum[idx].Length == period && cacheTBSum[idx].EqualsInput(input))
             {
                 return(cacheTBSum[idx]);
             }
         }
     }
     return(indicator.CacheIndicator(new TBSum()
     {
         Length = period, Input = input
     }, ref cacheTBSum));
 }