@@ -13,7 +13,7 @@ import { MessageService } from 'primeng/api';
13
13
import { AlgoQueueItem } from '@shared/services/trade.service' ;
14
14
import { ScoringIndex } from '@shared/services/score-keeper.service' ;
15
15
import { MachineDaytradingService } from '../machine-daytrading/machine-daytrading.service' ;
16
- import { BearList , PrimaryList , PersonalBullishPicks , PersonalBearishPicks } from '../rh-table/backtest-stocks.constant' ;
16
+ import { BearList , PrimaryList , PersonalBullishPicks , PersonalBearishPicks , OldList } from '../rh-table/backtest-stocks.constant' ;
17
17
import { AiPicksPredictionData } from '@shared/services/ai-picks.service' ;
18
18
import Stocks from '../rh-table/backtest-stocks.constant' ;
19
19
import { FindPatternService } from '../strategies/find-pattern.service' ;
@@ -1180,8 +1180,31 @@ export class AutopilotComponent implements OnInit, OnDestroy {
1180
1180
} ) ;
1181
1181
}
1182
1182
1183
- test ( ) {
1184
- this . portfolioService . getInstrument ( '67066G104' ) . subscribe ( ( response ) => {
1183
+ async test ( ) {
1184
+ let counter = 0 ;
1185
+ const newList = [ ] ;
1186
+ while ( counter < OldList . length ) {
1187
+ const stock = OldList [ counter ] . ticker ;
1188
+
1189
+ if ( stock ) {
1190
+ this . schedulerService . schedule ( async ( ) => {
1191
+ try {
1192
+ const results = await this . portfolioService . getInstrument ( stock ) . toPromise ( ) ;
1193
+ if ( results [ stock ] ) {
1194
+ if ( results [ stock ] . fundamental . marketCap > 1900 ) {
1195
+ newList . push ( stock ) ;
1196
+ }
1197
+ }
1198
+ } catch ( err ) {
1199
+ console . log ( err ) ;
1200
+ }
1201
+ } , `findTrades` , null , false , 60000 ) ;
1202
+ }
1203
+
1204
+ counter ++ ;
1205
+ }
1206
+ console . log ( JSON . stringify ( newList ) ) ;
1207
+ this . portfolioService . getInstrument ( 'W' ) . subscribe ( ( response ) => {
1185
1208
console . log ( 'test123' , response ) ;
1186
1209
} ) ;
1187
1210
}
0 commit comments