public StockIndicator(StockIndicatorType type, bool active, float impact, StockMathToolkit.SmoothingType smoothingType, float min, float max, float step) { this.Type = type; this.IsActive = active; this.Impact = impact; this.SmoothingType = smoothingType; this.Range = new FloatPropertyRange(this.Type, min, max, step); }
public StockIndicator(StockIndicatorType type, bool active, float impact, StockMathToolkit.SmoothingType smoothingType) { this.Type = type; this.IsActive = active; this.Impact = impact; this.SmoothingType = smoothingType; this.Range = null; }
public FloatPropertyRange(StockIndicatorType indicatorType, float min, float max, float step) { this.Min = min; this.Max = max; this.Step = step; this.IndicatorType = indicatorType; this.Name = indicatorType.ToString(); if (max < min) { throw new System.Exception("Max is lower than min, please check your input"); } }
public void ActivateOnly(StockIndicatorType dataType) { foreach (StockIndicator stockIndicator in this.IndicatorDictionary.Values) { if (stockIndicator.Type == dataType) { stockIndicator.IsActive = true; } else { stockIndicator.IsActive = false; } } }
public float GetStockIndicator(StockIndicatorType indicatorType) { Type type = this.GetType(); System.Reflection.PropertyInfo propInfo = type.GetProperty(indicatorType.ToString()); if (propInfo == null) { return Serie.GetSerie(indicatorType).Values[Serie.IndexOf(this.DATE)]; } else { return (float)propInfo.GetValue(this, null); } }
public void SetIndicatorImpact(StockIndicatorType dataType, float impact) { this.IndicatorDictionary[dataType].Impact = impact; }