Ejemplo n.º 1
0
        /// <summary>
        /// Calculates candles from a file containing transactions
        /// </summary>
        /// <param name="pair"></param>
        /// <param name="candlesDurationInMin"></param>
        /// <param name="fromDateTime"></param>
        /// <param name="toDateTime"></param>
        /// <returns></returns>
        public static IList<OHLC> ReadCandlesFromCSVTransactions(CurrencyPair pair, int candlesDurationInMin, DateTime fromDateTime, DateTime? toDateTime = null)
        {
            var rep = new CSVCandleRepository();
            string market = pair != null ? pair.Exchange.BitcoinChartsCode : string.Empty;
            string currency = pair != null ? pair.Item2 : string.Empty;

            return rep.GetCandlesFromCSVTransactions(fromDateTime, toDateTime, candlesDurationInMin, pair);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Loads candles from a CSV file
 /// </summary>
 /// <param name="fileName">The name of the file</param>
 /// <param name="fromDateTime">The from date</param>
 /// <param name="toDateTime">The to date</param>
 /// <returns>A list of candles</returns>
 public static IList<OHLC> ReadCandlesFromCSV(string fileName, DateTime? fromDateTime = null, DateTime? toDateTime = null)
 {
     var rep = new CSVCandleRepository();
     return rep.GetCandlesFromCSVCandles(fileName, fromDateTime, toDateTime);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Saves a list of candles to a CSV file
 /// </summary>
 /// <param name="fileName">The file name</param>
 /// <param name="candles">The candles to save</param>
 public static void SaveCandlesToCSV(string fileName, IList<OHLC> candles)
 {
     var rep = new CSVCandleRepository();
     rep.SaveCandles(fileName, candles);
 }