import { Asset } from '../strategy/asset'; import { StrategyInfo } from './strategyInfo'; import { StrategyResult } from './strategyResult'; /** * Compares two strategy results by gain in descending order, treating a * missing gain as the worst possible value. * * Note: StrategyResult.gain is typed as `number`, but at runtime it can be * `undefined` when an asset has empty price history (e.g. the gains array * computed by applyActions() is empty, so its last element is `undefined`). * Falling back to `-Infinity` for a missing gain keeps the comparator from * ever returning NaN, which Array.prototype.sort treats as 0 and would * otherwise leave such entries in an arbitrary position instead of * consistently sorting them to the bottom. * * @param a first strategy result. * @param b second strategy result. * @return comparison result. */ export declare function compareStrategyResultsByGainDesc(a: StrategyResult, b: StrategyResult): number; /** * Backtests the given strategies. * * @param asset asset object. * @param infos strategy infos. * @return strategy results. */ export declare function backtest(asset: Asset, infos: StrategyInfo[]): StrategyResult[];