/// <summary>Generate a filepath for the given pair name</summary> public static string DBFilePath(string exchange_name, string pair_name) { var dbpath = Misc.ResolveUserPath("PriceData", $"{Path_.SanitiseFileName(pair_name)} - {Path_.SanitiseFileName(exchange_name)}.db"); Path_.CreateDirs(Path_.Directory(dbpath)); return(dbpath); }
// Notes: // Startup Process: // - The application is idle until a user is assigned. Setting the user allows // the exchanges to be created (with API keys), followed by the main loop // starting up. // - Each exchange constructor creates an instance of its API object. There // shouldn't be any async/API calls during construction, instead a dispatcher // action is queued by each exchange to run the InitAsync() method of each // API object. Following that, the updates are called once to initialise // data, and then the 'UpdateThreadActive' is set true (if active according // to the settings). // - Exchanges should use the 'IntegrateDataUpdates' mechanism for merging new // live exchange data because it is controllable when switching to back testing // mode. static Model() { Log = new Logger("CoinFlip", new LogToFile(Misc.ResolveUserPath("Logs\\log.txt"), LogToFile.EFlags.None)); Log.TimeZero = Log.TimeZero - Log.TimeZero.TimeOfDay; Log.Write(ELogLevel.Debug, "<<< Started >>>"); DataUpdates = new BlockingCollection <Action>(); }