Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
        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");
             }
        }
Ejemplo n.º 4
0
 public void ActivateOnly(StockIndicatorType dataType)
 {
     foreach (StockIndicator stockIndicator in this.IndicatorDictionary.Values)
      {
     if (stockIndicator.Type == dataType)
     {
        stockIndicator.IsActive = true;
     }
     else
     {
        stockIndicator.IsActive = false;
     }
      }
 }
Ejemplo n.º 5
0
 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);
      }
 }
Ejemplo n.º 6
0
 public void SetIndicatorImpact(StockIndicatorType dataType, float impact)
 {
     this.IndicatorDictionary[dataType].Impact = impact;
 }