public LottoXClient(RagingBullConfig rbConfig, OCRConfig ocrConfig, PortfolioDatabase database, MarketDataClient marketDataClient) : base(rbConfig, database, marketDataClient) { PositionBuilder positionBuilder = new PositionBuilder(marketDataClient, database); FilledOrderBuilder orderBuilder = new FilledOrderBuilder(marketDataClient, database); ImageToPositionsConverter = new ImageToPositionsConverter(ocrConfig, positionBuilder); ImageToOrdersConverter = new ImageToOrdersConverter(ocrConfig, orderBuilder); QuantityConsistencyClient = new ImageConsistencyClient(); HeaderConsistencyClient = new ImageConsistencyClient(); OrderConsistencyClient = new ImageConsistencyClient(); }
public override async Task <IEnumerable <Position> > RecognizeLivePositions() { Log.Information("Getting live positions"); string filepath = GetNextPortfolioFilepath(); await TakePortfolioScreenshot(filepath); IEnumerable <Position> positions = await ImageToPositionsConverter.BuildModelsFromImage(filepath); //IList <Position> positions = await ImageToPositionsConverter.GetPositionsFromImage("C:/Users/Admin/WindowsServices/MarketCode/LottoXService/screenshots/new.json", // "C:/Users/Admin/WindowsServices/MarketCode/LottoXService/screenshots/new.json" // ); return(positions); }
public async Task <IEnumerable <Position> > GetPositionsFromImage(string filePath, string?writeToJsonPath = null) { IEnumerable <Position> positions = await ImageToPositionsConverter.BuildModelsFromImage(filePath, writeToJsonPath); return(positions); }