Beispiel #1
0
 public override void Insert(DateTime updateTime, Indicator indicator, decimal value)
 {
     if ((Math.Abs(_expectedIndicatorData[indicator.Id].Value(updateTime).Value.Value.Bid - value) > TOLERANCE))
     {
         string error = "Test failed: indicator " + indicator.Name + " time " + updateTime.ToShortTimeString() + " expected value " +
            _expectedIndicatorData[indicator.Id].Value(updateTime).Value.Value.Bid + " != " + value;
         Log.Instance.WriteEntry(error, EventLogEntryType.Error);
         throw new ApplicationException(error);
     }
 }
Beispiel #2
0
 public abstract void Insert(DateTime updateTime, Indicator indicator, decimal value);
Beispiel #3
0
 public override void Insert(DateTime updateTime, Indicator indicator, decimal value)
 {
     check(updateTime, indicator.Id);
     if (indicator.Id.Contains("Low") || indicator.Id.Contains("High") ||
         indicator.Id.Contains("CloseBid") || indicator.Id.Contains("CloseOffer")){
         // insert end of day level
         Insert(indicator.Id, value);
     }
     var newLine = string.Format("{0},{1},{2},{3}{4}",
         DATATYPE_INDICATOR, indicator.Id,
         formatDateTime(updateTime), value, Environment.NewLine);
     _csvIndicatorStringBuilder.Append(newLine);
 }