本文整理汇总了C#中BarData类的典型用法代码示例。如果您正苦于以下问题:C# BarData类的具体用法?C# BarData怎么用?C# BarData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BarData类属于命名空间,在下文中一共展示了BarData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: switch
public double this[DateTime dateTime, BarData barData]
{
get
{
Bar bar = this[dateTime];
switch (barData)
{
case BarData.Close:
return bar.Close;
case BarData.Open:
return bar.Open;
case BarData.High:
return bar.High;
case BarData.Low:
return bar.Low;
case BarData.Median:
return bar.Median;
case BarData.Typical:
return bar.Typical;
case BarData.Weighted:
return bar.Weighted;
case BarData.Average:
return bar.Average;
case BarData.Volume:
return (double)bar.Volume;
case BarData.OpenInt:
return (double)bar.OpenInt;
default:
throw new NotSupportedException("BarData " + barData + " is not supported");
}
}
}
示例2:
public override double this[int index, BarData barData]
{
get
{
return this[index][barData];
}
}
示例3: Value
// TODO: rewrite
public static double Value(ISeries input, int index, int length, BarData barData = BarData.Close, RegressionDistanceMode distanceMode = RegressionDistanceMode.Time)
{
if (index >= length - 1)
{
double num = 0.0;
double num2 = 0.0;
double num3 = 0.0;
double num4 = 0.0;
if (distanceMode == RegressionDistanceMode.Time)
{
double num5 = input.GetDateTime(index).Subtract(input.GetDateTime(index - 1)).Ticks;
for (int i = index; i > index - length; i--)
{
num += input.GetDateTime(i).Subtract(input.GetDateTime(index - length + 1)).Ticks / num5;
num2 += input.GetDateTime(i).Subtract(input.GetDateTime(index - length + 1)).Ticks / num5 * input[i, barData];
num3 += input[i, barData];
num4 += input.GetDateTime(i).Subtract(input.GetDateTime(index - length + 1)).Ticks / num5 * input.GetDateTime(i).Subtract(input.GetDateTime(index - length + 1)).Ticks / num5;
}
}
else
{
for (int j = index; j > index - length; j--)
{
num += j - index + length - 1;
num2 += (j - index + length - 1) * input[j, barData];
num3 += input[j, barData];
num4 += ((j - index + length - 1) * (j - index + length - 1));
}
}
return (length * num2 - num * num3) / (length * num4 - Math.Pow(num, 2.0));
}
return double.NaN;
}
示例4: LRS
public LRS(ISeries input, int length, BarData barData = BarData.Close, RegressionDistanceMode distanceMode = RegressionDistanceMode.Time) : base(input)
{
this.length = length;
this.barData = barData;
this.distanceMode = distanceMode;
this.Init();
}
示例5: DPO1
public DPO1(ISeries series, int length, BarData barData)
: base(series)
{
this.length = length;
this.option = barData;
this.Name = "DPO";
}
示例6: DPO1
public DPO1(ISeries series, int length, BarData barData)
: base(series)
{
this.length = length;//长度
this.option = barData;//bar类型
this.Name = "DPO";//名称
}
示例7: ENVU
public ENVU(ISeries input, int length, double shift, BarData barData = BarData.Close) : base(input)
{
this.length = length;
this.shift = shift;
this.barData = barData;
this.Init();
}
示例8: HV
public HV(ISeries input, int length, double span, BarData barData = BarData.Close) : base(input)
{
this.length = length;
this.span = span;
this.barData = barData;
Init();
}
示例9: SMA
public SMA(TimeSeries input, int length, BarData option, Color color) : base(input)
{
this.fLength = length;
this.fOption = option;
this.Init();
this.Color = color;
}
示例10: PERF
public PERF(TimeSeries input, double k, BarData option) : base(input)
{
this.fK = 14.0;
this.fOption = option;
this.fK = k;
this.Init();
}
示例11: EMA
public EMA(TimeSeries input, int length, BarData option) : base(input)
{
this.fLength = 14;
this.fLength = length;
this.fOption = option;
this.Init();
}
示例12:
public double this[int index, BarData barData]
{
get
{
return this.series[index];
}
}
示例13:
public double this[DateTime dateTime, BarData barData]
{
get
{
return this.series[dateTime];
}
}
示例14: OSC
public OSC(ISeries input, int length1, int length2, BarData barData = BarData.Close) : base(input)
{
this.length1 = length1;
this.length2 = length2;
this.barData = barData;
this.Init();
}
示例15: RSI
public RSI(TimeSeries input, int length, BarData option, EIndicatorStyle style)
: base(input){
this.fLength = 14;
this.fLength = length;
this.fOption = option;
this.fStyle = style;
this.Init();
}