开发投顾零碎的重要几个点:
1. 投顾治理 CRM 零碎,对投顾能够进行治理及分割记录记录
2. 策略剖析模块,可对不同投顾的多种策略进行图形化剖析,查看策略的区间收益,回撤与指数的相关性、指数超额、危险归因等信息
3. 策略比照性能,可对不同策略进行比照,并能够设定权重模仿组合等
4. 策略与实盘曲线比照性能,能够将实盘曲线附加到回测曲线中找出实盘与回测的差别
5. 策略相关性剖析,可查看策略间互补性,为组合投资找出投资根据
6. 策略组合性能,能够模仿一笔钱扩散投入到不同类型的策略中模仿历史整体组合的收益及危险状况,并能够指定工夫节点进行调仓模仿尽可能靠近实在投资体现
7. 投后治理性能,可对已有的投资进行分组治理,对扩散的多笔实在投资进行投资组合的体现查看,与投资打算进行比照。投后反对产品、融航子帐号、期货单帐号、股票单帐号等形式主动采集数据,缩小人工输出的压力
失去计算策略指标源代如下:guweng22346
public static RiskIndicatorsVo calcRisk(Integer strategyId, List<Pnl> pnls) {RiskIndicatorsVo riskIndicatorsVo = new RiskIndicatorsVo();
riskIndicatorsVo.setStrategyId(strategyId);
if (CollectionUtils.isEmpty(pnls) && CollectionUtils.isEmpty(pnls.stream().filter(f -> {return f.getPnl() != null;}).collect(Collectors.toList()))) {return riskIndicatorsVo;}
double simpleYearIncomRate = 0;
try {simpleYearIncomRate = DataUtils.calcSimpleYearIncomRate(pnls);
} catch (Exception e) {log.info("策略 id:{}, 计算年化收益出错, {}", strategyId, e.getMessage());
return riskIndicatorsVo;
}
riskIndicatorsVo.setAnnualizedIncomeRate(String.valueOf(DataUtils.round(simpleYearIncomRate, 2)));
List<Pnl> pnls1 = DataUtils.accumulationPnl(pnls);
// 年化稳定
NetworthMonth networthMonth = new NetworthMonth();
networthMonth.setStrategyId(strategyId);
double simpleFluctuatiearonByDay = 0.0;
if (pnls.size() > 2) {//v2 = NetWorthDataUtils.getFluctuationByDaySingle(netWorthsByStrategyId);
simpleFluctuatiearonByDay = DataUtils.calcSimpleYearFluctuatiearonByDay(pnls);
}
riskIndicatorsVo.setAnnualFluctuationsRate(DataUtils.round(simpleFluctuatiearonByDay, 2) + "%");
// 夏普率
double simpleSharpRate = 0.0;
if (pnls.size() > 2) {//v4 = DataUtils.div(DataUtils.sub(DataUtils.mul(simpleYearIncomRate, 100.0), 2.0), simpleFluctuatiearonByDay, 2);
simpleSharpRate = DataUtils.calcSimpleSharp(simpleYearIncomRate, 2.0, simpleFluctuatiearonByDay);
}
riskIndicatorsVo.setSharpeRate(DataUtils.dataFormatStr(simpleSharpRate,2));
// 最大回撤
//double v5 = NetWorthDataUtils.getMaxPullback(netWorthsByStrategyId);
Double maxDrawDown = DataUtils.calcSimpleMaxDrawDownIndex(pnls1);
riskIndicatorsVo.setMaximumDrawdownRate(DataUtils.round(maxDrawDown, 2) + "%");
//calmar 比率
double calmar = 0.0;
if (maxDrawDown != 0.0){//calmar = DataUtils.div(DataUtils.dataFormat(DataUtils.mul(simpleYearIncomRate, 100.0), 2), v5 ,2);
calmar = DataUtils.calcCalmarRate(simpleYearIncomRate, maxDrawDown);
}
riskIndicatorsVo.setCalmarRate(String.valueOf(calmar));
riskIndicatorsVo.setStrategyId(strategyId);
// 最大回补天数
riskIndicatorsVo.setMaxBackIncomDay(NetWorthDataUtils.getPullBackDay(pnls1));
// 投资胜率
riskIndicatorsVo.setInvestWinningRate(DataUtils.calcWinRate(pnls));
return riskIndicatorsVo;
}
综上所述,投顾零碎源码的开发是一个简单而重要的过程。