/// <summary> /// Checks that the factor file exists on disk, and if it does, loads it into memory /// </summary> private FactorFile GetFactorFile(Symbol symbol, string permtick, string market) { if (FactorFile.HasScalingFactors(permtick, market)) { var factorFile = FactorFile.Read(permtick, market); _cache.AddOrUpdate(symbol, factorFile, (s, c) => factorFile); return(factorFile); } // return null if not found return(null); }
/// <summary> /// Checks that the factor file exists on disk, and if it does, loads it into memory /// </summary> private FactorFile GetFactorFile(Symbol symbol, string permtick, string market) { FactorFile factorFile = null; if (FactorFile.HasScalingFactors(permtick, market)) { factorFile = FactorFile.Read(permtick, market); _cache.AddOrUpdate(symbol, factorFile, (s, c) => factorFile); } else { // add null value to the cache, we don't want to check the disk multiple times // but keep existing value if it exists, just in case _cache.AddOrUpdate(symbol, factorFile, (s, oldValue) => oldValue); } return(factorFile); }