public static Quarter Create(string ticker, uint fiscalYear, uint fiscalQuarter, PropertyDictionary properties, PropertyDescriptionDictionary descriptions) { JpTickerValidator.Validate(ticker); var period = FiscalQuarterPeriod.Create(fiscalYear, fiscalQuarter); return(new Quarter(ticker, period, properties, descriptions)); }
public static TickerQuarterParameter Create(string ticker, string fyParam, string fqParam, IQuarterlyPeriod period) { JpTickerValidator.Validate(ticker); ApiFyParameterValidator.Validate(fyParam); ApiFqParameterValidator.Validate(fqParam); return(new TickerQuarterParameter(ticker, fyParam, fqParam, period)); }
public static CsvDownloadParameters Create(string ticker, FiscalQuarterPeriod from, FiscalQuarterPeriod to, CsvDownloadOutputSettings outputSettings) { JpTickerValidator.Validate(ticker); var range = PeriodRange <FiscalQuarterPeriod> .Create(from, to); return(new CsvDownloadParameters(ticker, range, outputSettings)); }
public static CsvDownloadParameters Load() { var ticker = Properties.Settings.Default.CSVTicker; JpTickerValidator.Validate(ticker); var from = FiscalQuarterPeriod.Parse(Properties.Settings.Default.CSVFrom); var to = FiscalQuarterPeriod.Parse(Properties.Settings.Default.CSVTo); var outputSettings = LoadOutputSettings(); return(CsvDownloadParameters.Create(ticker, from, to, outputSettings)); }
public static Company Create( string ticker, PeriodRange <FiscalQuarterPeriod> fixedTierQuarterRange, PeriodRange <FiscalQuarterPeriod> ondemandQuarterTierRange, PeriodRange <DayPeriod> fixedTierDayRange, PeriodRange <DayPeriod> ondemandTierDayRange, PropertyDictionary properties, PropertyDescriptionDictionary descriptions) { JpTickerValidator.Validate(ticker); return(new Company(ticker, fixedTierQuarterRange, ondemandQuarterTierRange, fixedTierDayRange, ondemandTierDayRange, properties, descriptions)); }
public uint OndemandTierRengeLength(string ticker) { JpTickerValidator.Validate(ticker); if (!Has(ticker)) { throw new KeyNotFoundException($"ticker={ticker} is not contained."); } else { return(tickerTierDict[ticker].OndemandTierRengeLength()); } }
public static TickerDayParameter Create(string ticker, IDailyPeriod period) { JpTickerValidator.Validate(ticker); if (period is LatestDayPeriod) { return(new TickerDayParameter(ticker, ApiRequestParamConfig.ValueLatest, period)); } else if (period is DayPeriod) { return(new TickerDayParameter(ticker, period.ToString(), period)); } else { throw new ArgumentException($"{period} is not supported."); } }
public static TickerDayParameter Create(string ticker, string dateParam) { JpTickerValidator.Validate(ticker); if (dateParam.Equals(ApiRequestParamConfig.ValueLatest)) { return(new TickerDayParameter(ticker, ApiRequestParamConfig.ValueLatest, LatestDayPeriod.GetInstance())); } else if (PeriodRegularExpressionConfig.DayRegex.IsMatch(dateParam)) { return(new TickerDayParameter(ticker, dateParam, DayPeriod.Parse(dateParam))); } else { throw new ValidationError($"input {dateParam} is not supported format"); } }
public void TestJpTickerValidator() { var tickers = new List <String> { "1000", "2000", "9999" }; tickers.ForEach(ticker => JpTickerValidator.Validate(ticker)); var nonTickers = new List <String> { "999", "10000", "aaa" }; nonTickers.ForEach( noTicker => Assert.ThrowsException <ValidationError>(() => JpTickerValidator.Validate(noTicker))); }
public SupportedTier Get(string ticker, T period) { JpTickerValidator.Validate(ticker); if (!Has(ticker)) { throw new KeyNotFoundException($"ticker={ticker} is not contained."); } else { var supportedTier = tickerTierDict[ticker]; if (supportedTier.FixedTierRange.Includes(period)) { return(SupportedTier.FixedTier); } else if (supportedTier.OndemandTierRange.Includes(period)) { return(SupportedTier.OndemandTier); } else { return(SupportedTier.None); } } }
public bool Has(string ticker) { JpTickerValidator.Validate(ticker); return(tickerTierDict.ContainsKey(ticker)); }
public void Add(string ticker, SupportedTierRange <T> supportedTierRange) { JpTickerValidator.Validate(ticker); tickerTierDict.Add(ticker, supportedTierRange); }
public static Daily Create(string ticker, DayPeriod period, PropertyDictionary properties, PropertyDescriptionDictionary descriptions) { JpTickerValidator.Validate(ticker); return(new Daily(ticker, period, properties, descriptions)); }
public static TickerEmptyPeriodParameter Create(string ticker, IPeriod period) { JpTickerValidator.Validate(ticker); return(new TickerEmptyPeriodParameter(ticker, period)); }
public TickerParameterBuilderForLegacy SetTicker(string ticker) { JpTickerValidator.Validate(ticker); this.ticker = ticker; return(this); }
public static TickerPeriodRangeParameter Create(string ticker, IComparablePeriod from, IComparablePeriod to) { JpTickerValidator.Validate(ticker); return(new TickerPeriodRangeParameter(ticker, PeriodRange <IComparablePeriod> .Create(from, to))); }
public static TickerPeriodRangeParameter Create(string ticker, PeriodRange <IComparablePeriod> periodRange) { JpTickerValidator.Validate(ticker); return(new TickerPeriodRangeParameter(ticker, periodRange)); }
public static Indicator Create(string ticker, PropertyDictionary properties, PropertyDescriptionDictionary descriptions) { JpTickerValidator.Validate(ticker); return(new Indicator(ticker, properties, descriptions)); }