本文整理汇总了C#中StockSerie.CalculateSAR2方法的典型用法代码示例。如果您正苦于以下问题:C# StockSerie.CalculateSAR2方法的具体用法?C# StockSerie.CalculateSAR2怎么用?C# StockSerie.CalculateSAR2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StockSerie
的用法示例。
在下文中一共展示了StockSerie.CalculateSAR2方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyTo
public override void ApplyTo(StockSerie stockSerie)
{
float accelerationFactorStep = (float)this.parameters[0];
float accelerationFactorMax = (float)this.parameters[1];
FloatSerie sarSupport1;
FloatSerie sarResistance1;
FloatSerie sarSupport2;
FloatSerie sarResistance2;
float ratio = (float)this.parameters[2];
stockSerie.CalculateSAR(accelerationFactorStep, accelerationFactorStep, accelerationFactorMax, out sarSupport1, out sarResistance1, 1);
stockSerie.CalculateSAR2(accelerationFactorStep / ratio, accelerationFactorStep / ratio, accelerationFactorMax / ratio, sarSupport1, sarResistance1, out sarSupport2, out sarResistance2);
this.Series[0] = sarSupport1;
this.Series[1] = sarResistance1;
this.Series[2] = sarSupport2;
this.Series[3] = sarResistance2;
// Detecting events
this.CreateEventSeries(stockSerie.Count);
for (int i = 5; i < stockSerie.Count; i++)
{
this.Events[0][i] = float.IsNaN(sarResistance1[i - 1]) && !float.IsNaN(sarResistance1[i]);
this.Events[1][i] = float.IsNaN(sarSupport1[i - 1]) && !float.IsNaN(sarSupport1[i]);
this.Events[2][i] = float.IsNaN(sarResistance2[i - 1]) && !float.IsNaN(sarResistance2[i]);
this.Events[3][i] = float.IsNaN(sarSupport2[i - 1]) && !float.IsNaN(sarSupport2[i]);
}
}