public MockBaseDealingServer() { StockExchId = CodesStockExch._04_CryptoBitfinex; GlobalConfig = new CGlobalConfig(); DictInstruments = new Dictionary <string, CInstrument>(); /* DictInstruments = new Dictionary<string, CInstrument>() * { * {"BTCUSD", new CInstrument{ DecimalVolume = 3, * Min_step=0.1m, * RoundTo=1, * minimum_order_size=0.002m * } * } * * }; */ DBCommunicator = new CDBCommunicator("atfs", this); DBCommunicator.WaitReadyForOperations(); Instruments = new CListInstruments(this, GlobalConfig); Instruments.LoadDataFromDB(); // Instruments = new CListInstruments(this, GlobalConfig); }
public CLogger(string fileName, bool flushMode = true, string subDir = "", bool useMicroseconds = false) { _subDir = subDir; m_fileName = fileName; m_flushMode = flushMode; m_useMicroseconds = useMicroseconds; string m_rootDir = Application.StartupPath; // _creationTime = DateTime.Now; string pathToConfig = CUtil.GetConfigDir() + @"\globalSettings.xml"; //System.AppDomain.CurrentDomain.BaseDirectory + @"config\globalSettings.xml"; CGlobalConfig GlobalConfig = new CGlobalConfig(pathToConfig); CSerializator.Read <CGlobalConfig>(ref GlobalConfig); // CSerializator.Write<CGlobalConfig>(ref GlobalConfig); if (GlobalConfig.LogExternal) { //string stEnvPathToLog = GlobalConfig.EnvVarLogFilePath; stLogDir = CUtil.GetLogDir() + "\\"; /// Environment.GetEnvironmentVariable(stEnvPathToLog); } else { stLogDir = m_rootDir + "\\log\\"; } CreateNewFile(bInitial: true); }
private void ReadGlobalConfig() { string pathFile = CUtil.GetConfigDir() + @"\globalSettings.xml"; _globalConfig = new CGlobalConfig(pathFile); CSerializator.Read <CGlobalConfig>(ref _globalConfig); }
public MainWindow() { InitializeComponent(); Closing += OnWindowClosing; string pathToConfig = CUtil.GetConfigDir() + @"\globalSettings.xml"; //System.AppDomain.CurrentDomain.BaseDirectory + @"config\globalSettings.xml"; CGlobalConfig GlobalConfig = new CGlobalConfig(pathToConfig); CSerializator.Read <CGlobalConfig>(ref GlobalConfig); (new Thread(ThreadTCPClient)).Start(); Stock.ModelMarket = modelMarket; Stock.SetParameters(10); Stock.CreateStockRecords(); }
public CListInstruments(/*CDBCommunicator dbCommunicator, * Dictionary<string, long> dictIsin, * Dictionary<long, string> dictIsin_id, * ref bool isDictIsinAvail*/ IClientInstruments client, CGlobalConfig globalConfig ) : base() { _client = client; _dbCommunicator = _client.DBCommunicator; _globalConfig = globalConfig; //dictIsin = _client.DictInstr_IsinId; //_dictIsin_id = _client.DictIsin_id; InitInstAvailability(); _dictInstruments = _client.DictInstruments; _logger = new CLogger("CListInstruments"); }