private static DateTime? GetXyDate(RawAsset raw) { DateTime? prio1 = Extraction.ExtractMultipleFromCids(raw.Cids, cid => cid.dateFrom_A).Where(dt => dt < DateTime.Now).Min(); Func<DateTime?> prio2 = () => raw.Xcds.Select(xcd => xcd.GXCD.GVAI.GMGG.XCA.entitledForBegin).Where(dt => dt < DateTime.Now).Max(); Func<DateTime?> prio31 = () => raw.Fzd.GFZD.GVAI_A.FZY.intrFrom_B; Func<DateTime?> prio32 = () => raw.Emd.GEMD.GVAI.GMGG.EMA.K819.intrusionDate; Func<DateTime?> prio33 = () => raw.Emd.GEMD.GVAI.GMGG.EMA.intrusionDate2_C; return prio1 ?? prio2() ?? prio31() ?? prio32() ?? prio33(); }
public static void NormalizeBond(TTarget target, RawAsset raw) { NormalizationElements normalizationElements = new NormalizationElements(raw); target.SecSubType = GetBondSecSubType(raw); target.SecComplementType = GetSecComplementType(raw); target.SecCurrency = normalizationElements.SecCurrency(() => target.SecCurrency); ... many more target.FlatIndicator = GetFlatIndicator(raw.Hxds); }
private static SecSubType GetBondSecSubType(RawAsset raw) { var NameElements = Extraction.GetNames(raw.Fad); return new { tk_instrumentType = Extraction.GetFadFmb_instrType(raw.Fad), ... another 15 tk_marketAffiliation = Extraction.GetInstrumentCategory(raw.Fad, "MAXU"), tk_productName = Extraction.GetProductName(audit, raw.Fad) }.Map<SecSubType>("tk_BondSecSubType"); } ....
/// <summary> /// コンストラクタ /// </summary> /// <param name="_asset">取得した資産情報</param> public Asset(RawAsset _asset) { Code = (AssetCode)Enum.Parse(typeof(AssetCode), _asset.currency_code, true); Amount = _asset.amount; Available = _asset.available; }