private void btnGetSymbols_Click(object sender, EventArgs e) { var msgFactory = new OpenApiMessagesFactory(); var msg = msgFactory.CreateSymbolsListRequest(_accountID); Transmit(msg); }
private void GetSymbols(long ctraderAccountId) { //get the associated user config UserConfig config = Users.Where(x => x.Value.AccountId == ctraderAccountId).Select(x => x.Value).FirstOrDefault(); if (config == null) { ErrorHandler?.Invoke("Could not find account " + ctraderAccountId + ". Ticks will not be recorded for this account."); } else { //if symbols aren't loaded then get symbols from api if (config.Symbols.Count == 0) { MessageHandler?.Invoke("Retrieving symbol list for account " + ctraderAccountId + "."); var msgFactory = new OpenApiMessagesFactory(); _trasmitQueue.Enqueue(msgFactory.CreateSymbolsListRequest(config.AccountId)); } //otherwise go to StartSubscribes else { StartSubscribes(ctraderAccountId); } } }