public string ToCsv() { return($"F,{Symbol},{ExchangeId},{PE.ToInvariantString()},{AverageVolume.ToInvariantString()},{FiftyTwoWeekHigh.ToInvariantString()}," + $"{FiftyTwoWeekLow.ToInvariantString()},{CalendarYearHigh.ToInvariantString()},{CalendarYearLow.ToInvariantString()},{DividendYield.ToInvariantString()}," + $"{DividendAmount.ToInvariantString()},{DividendRate.ToInvariantString()},{PayDate.ToInvariantString(FundamentalDateTimeFormat)}," + $"{ExDividendDate.ToInvariantString(FundamentalDateTimeFormat)}," + $"{CurrentYearEarningsPerShare.ToInvariantString()},{NextYearEarningsPerShare.ToInvariantString()},{FiveYearGrowthPercentage.ToInvariantString()}," + $"{FiscalYearEnd.ToInvariantString()},{CompanyName},{RootOptionSymbol},{PercentHeldByInstitutions.ToInvariantString()}," + $"{Beta.ToInvariantString()},{Leaps},{CurrentAssets.ToInvariantString()},{CurrentLiabilities.ToInvariantString()}," + $"{BalanceSheetDate.ToInvariantString(FundamentalDateTimeFormat)},{LongTermDebt.ToInvariantString()},{CommonSharesOutstanding.ToInvariantString()}," + $"{SplitFactor1},{SplitFactor2},{FormatCode},{Precision.ToInvariantString()},{SIC.ToInvariantString()}," + $"{HistoricalVolatility.ToInvariantString()},{SecurityType},{ListedMarket},{FiftyTwoWeekHighDate.ToInvariantString(FundamentalDateTimeFormat)}," + $"{FiftyTwoWeekLowDate.ToInvariantString(FundamentalDateTimeFormat)},{CalendarYearHighDate.ToInvariantString(FundamentalDateTimeFormat)}," + $"{CalendarYearLowDate.ToInvariantString(FundamentalDateTimeFormat)},{YearEndClose.ToInvariantString()},{MaturityDate.ToInvariantString(FundamentalDateTimeFormat)}," + $"{CouponRate.ToInvariantString()},{ExpirationDate.ToInvariantString(FundamentalDateTimeFormat)},{StrikePrice.ToInvariantString()}," + $"{NAICS.ToInvariantString()},{ExchangeRoot},{OptionsPremiumMultiplier.ToInvariantString()},{OptionsMultipleDeliverables.ToInvariantString()}," + $"{SessionOpenTime.ToInvariantString(FundamentalTimeSpanFormat)},{SessionCloseTime.ToInvariantString(FundamentalTimeSpanFormat)}," + $"{BaseCurrency},{ContractSize},{ContractMonths},{MinimumTickSize.ToInvariantString()},{FirstDeliveryDate.ToInvariantString(FundamentalDateTimeFormat)}," + $"{FIGI},{SecuritySubType.ToInvariantString()}"); }
protected override void Execute(CodeActivityContext context) { String valYear = Year.Get <string>(context); OptionSetValue valFiscalYearEnd = FiscalYearEnd.Get <OptionSetValue>(context); DateTime retYearEndDate = new DateTime(); int intYear = Convert.ToInt32(valYear); if (valFiscalYearEnd.Value < 13 && valFiscalYearEnd.Value > 0) { //build a date with our month and year for the first of the month retYearEndDate = new DateTime(intYear, valFiscalYearEnd.Value, 1); //add month retYearEndDate = retYearEndDate.AddMonths(1); //subtract a day retYearEndDate = retYearEndDate.AddDays(-1); } YearEndDate.Set(context, retYearEndDate); }