本文整理汇总了TypeScript中backlive/service.StrategyService类的典型用法代码示例。如果您正苦于以下问题:TypeScript StrategyService类的具体用法?TypeScript StrategyService怎么用?TypeScript StrategyService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StrategyService类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(appService: AppService, strategyService: StrategyService) {
super(appService);
this.strategyService = strategyService;
this.strategyService.getBacktests().then((strategies: Strategy[]) => this.loadStrategies(strategies));
var items = [
{ icon: "search", component: SearchBarComponent },
{ icon: "video", onClick: () => this.filterMenu(), tooltip:'test' },
{ icon: "list", onClick: () => this.filterMenu() },
{ icon: "settings", component: null }
];
appService.notify(AppEvent.SlidingNavItems, items);
}
示例2: getReturns
getReturns() {
this.strategyService.getReturns(this.liveStrategies.map(strategy => { return strategy._id; }), 20160101, 20170101).then(res => {
var strats = res.data;
console.log(strats);
for(var id in strats) {
var lastIndex = strats[id].returns.length - 1;
this.stratsById[strats[id].bt_id].results = new Performance(
strats[id].returns[0].capital,
strats[id].returns[lastIndex].capital,
strats[id].returns[0].date,
strats[id].returns[lastIndex].date
);
}
setTimeout(() => {
this.iso.resize();
}, 1000);
});
}