Skip to content

Commit acad8ca

Browse files
committed
Fix set list
1 parent acdedde commit acad8ca

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/app/autopilot/autopilot.component.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,10 +610,17 @@ export class AutopilotComponent implements OnInit, OnDestroy {
610610
return null;
611611
}
612612

613+
async backtestList(cb = async (stock: string, mlResult: number) => { }, stockList: (PortfolioInfoHolding[] | any[]) = CurrentStockList) {
614+
615+
stockList.forEach(async (stock) => {
616+
const backtestResults = await this.backtestTableService.getBacktestData(stock.name);
617+
if (backtestResults) {
618+
cb(stock, backtestResults.ml);
619+
}
620+
});
621+
}
622+
613623
async findSwingtrades(cb = async (stock: string, mlResult: number) => { }, stockList: (PortfolioInfoHolding[] | any[]) = CurrentStockList) {
614-
if (stockList) {
615-
this.machineDaytradingService.setCurrentStockList(stockList);
616-
}
617624
let stock;
618625
const found = (name) => {
619626
return Boolean(this.currentHoldings.find((value) => value.name === name));
@@ -987,7 +994,7 @@ export class AutopilotComponent implements OnInit, OnDestroy {
987994
}
988995
};
989996

990-
this.findSwingtrades(callback, this.currentHoldings);
997+
this.backtestList(callback, this.currentHoldings);
991998
}
992999

9931000
async analyseRecommendations(holding: PortfolioInfoHolding) {

0 commit comments

Comments
 (0)