public async Task StartActives() { foreach (var activeInstrument in (await _instrumentsAccessService.GetAllAsync()).Where(x => x.State == InstrumentState.Active)) { await Start(activeInstrument.AssetPair); } }
public async Task <IReadOnlyList <Price> > GetActiveAsync(OrderType type) { var activeInstruments = (await _instrumentsAccessService.GetAllAsync()) .Where(x => x.State == InstrumentState.Active); var prices = new List <Price>(); foreach (var instrument in activeInstruments) { var lastPrice = await GetLatestAsync(instrument.AssetPair, type); if (lastPrice != null) { prices.Add(lastPrice); } } return(prices); }
public Task <IReadOnlyCollection <Instrument> > GetAllAsync() { return(_instrumentsAccessService.GetAllAsync()); }