public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode) { var source = Path.Combine(Globals.DataFolder, "equity", "usa", config.Resolution.ToString().ToLower(), Symbols.SPY.Value.ToLowerInvariant(), LeanData.GenerateZipFileName(Symbols.SPY, date, config.Resolution, config.TickType)); return(new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.Csv)); }
public void DecomposesAccordingToLeanDataFileGeneration(Arguments args) { var sourceString = LeanData.GenerateRelativeZipFilePath(args.Symbol, args.Date, args.Resolution, args.TickType); var decomposed = LeanDataPathComponents.Parse(sourceString); var expectedFileName = LeanData.GenerateZipFileName(args.Symbol, args.Date, args.Resolution, args.TickType); Assert.AreEqual(args.Symbol, decomposed.Symbol); Assert.AreEqual(args.Date, decomposed.Date); Assert.AreEqual(expectedFileName, decomposed.Filename); Assert.AreEqual(args.Symbol.ID.SecurityType, decomposed.SecurityType); Assert.AreEqual(args.Symbol.ID.Market, decomposed.Market); Assert.AreEqual(args.TickType, decomposed.TickType); Assert.AreEqual(args.Market, decomposed.Market); }
public void GenerateZipFileName(LeanDataTestParameters parameters) { var zip = LeanData.GenerateZipFileName(parameters.Symbol, parameters.Date, parameters.Resolution, parameters.TickType); Assert.AreEqual(parameters.ExpectedZipFileName, zip); }