Exemple #1
0
        public static void ProcessQuotation(Quotation quotation, int volume)
        {
            CandleBuilder builder;

            if (!builders.TryGetValue(quotation.InstrumentID, out builder))
            {
                builder = new CandleBuilder(CandleDAL.GetLast(quotation.InstrumentID), CandleType.Minute);
                builders.Add(quotation.InstrumentID, builder);
            }
            builder.ProcessQuotation(quotation, volume);
            DataSaver.AddCandle(builder.LastData);
        }
Exemple #2
0
        public static List <Candle> GetCandles(string instrumentID, CandleType type, DateTime fromTradingDay)
        {
            List <Candle> minuteCandles = CandleDAL.Get(instrumentID, fromTradingDay);

            if (type == CandleType.Minute)
            {
                return(minuteCandles);
            }
            else
            {
                return(CandleHelper.ConvertCandleToCandle(minuteCandles, type));
            }
        }