@Override protected void execute() throws Exception { Formula formula = Formula.create() .putConstant("162.31") .putMultinomial(ProdEnum.JiaoTan, "1") .putMultinomial(ProdEnum.JiaoMei, "-1.60584"); dataProcessor.testEndPriceFormula("2014-01-01", "2016-09-02", formula); }
public List<Series> compareProd(Futures f1, Futures f2) { Series s1 = dailyPriceBuss.querySeriesByCode(f1.getCode(), -1); Series s2 = dailyPriceBuss.querySeriesByCode(f2.getCode(), -1); Formula formula = Formula.create() .putConstant(BigDecimal.ZERO) .putMultinomial(f1.getCode(), "1") .putMultinomial(f2.getCode(), "-1"); List<Price> diffPriceList = this.calculateKLine(formula, dailyPriceBuss.queryAllGroup()); String diffName = f1.getName() + "-" + f2.getName(); Series diffSeries = new Series("", diffName, diffPriceList); return Arrays.asList(s1, s2, diffSeries); }