import * as Winston from "winston"; import { CandleUtils } from "./utils/CandleUtils"; import { ParametersCombination } from "./models/ParametersCombination"; import { BacktesterFacade } from "./facades/BacktesterFacade"; import { ResourcesManager } from "./singletons/ResourcesManager"; ( async () => { try { for( let configuration of ResourcesManager.context.configurations ) { let result: [ ParametersCombination, number ] = await BacktesterFacade.test( configuration, await CandleUtils.getDataSourceFromConfiguration( configuration ) ); Winston.info( `${ configuration.symbol } best match (${ result[ 1 ] }% gain) - Buy threshold: ${ result[ 0 ].buyThreshold }, sell threshold: ${ result[ 0 ].sellThreshold }, stop loss threshold: ${ result[ 0 ].stopLossThreshold }` ); } } catch( error ) { Winston.error( error ); } } )();