try {
Account account = new Account(new BigDecimal(initialBalance), DateTime.now().minusDays(days));
BuyZoneModel model = new BuyZoneModel(account, asset, conditions, moneyManager, buyTrigger, sellTrigger, stopLoss);
Session tradingSession = model.generateSignals(asset.getTimeSeries().beginningOfSeries(),
asset.getTimeSeries().lastOfSeries());
//return -tradingSession.grossProfit().doubleValue();
return -tradingSession.sharpeRatio();
} catch (Exception ex) {
ex.printStackTrace();
return Double.MAX_VALUE;
}