Bollinger Bands
定义
public static IEnumerable<BollingerBandsResult> GetBollingerBands( int lookbackPeriods = 20, double standardDeviations = 2)
描述
Bollinger Bands的核心思想是:价格应该在特定统计规律定义的上下边界内波动,而边界本身会随着市场波动性的变化而动态调整。
参数
| 参数名 |
类型 |
描述 |
| lookbackPeriods |
Int |
回溯周期 |
| standardDeviations |
Int |
标准差倍数 |
返回值
| 返回值 |
类型 |
描述 |
| Date |
DateTime |
时间戳 |
| Sma |
decimal? |
简单移动平均线。 |
| UpperBand |
decimal? |
上轨 |
| LowerBand |
decimal? |
下轨 |
| PercentB |
decimal? |
百分比B |
| ZScore |
decimal? |
Z值。统计指标 |
| Width |
decimal? |
带宽 |
示例
///清洗股票数据 天数据
QuoteHistoryDay(10, (dic) =>
{
if (dic.Count > 0)
{
foreach (var item in dic.Keys)
{
///获取指标结果
var resp = dic[item].GetBollingerBands(20,2);
Console.WriteLine(resp.ToJson());
}
}
});