public static void MergeCandle(this CandleTableEntity entity, CandleItem candle, TimeInterval interval) { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } IFeedCandle fc = candle.ToCandle(entity.IsBuy, entity.DateTime, interval); entity.MergeCandle(fc, interval); }
public static IFeedCandle ToCandle(this CandleItem candle, bool isBuy, DateTime baseTime, TimeInterval interval) { if (candle != null) { return(new FeedCandle() { Open = candle.Open, Close = candle.Close, High = candle.High, Low = candle.Low, IsBuy = isBuy, DateTime = baseTime.AddIntervalTicks(candle.Cell, candle.Tick, interval) }); } return(null); }