package com.smppw.core.reta.calc;


import com.smppw.constants.Consts;
import com.smppw.common.pojo.dto.CompoundRet;
import com.smppw.common.pojo.enums.Frequency;
import com.smppw.core.reta.Rate;
import com.smppw.utils.FunctionUtil;

import java.util.List;


/**
 * @author zhengsongliang
 * @datetime 2017年7月25日 上午10:22:41
 */
public class HistoricalVaR extends Rate {

	private Double prob;

	public HistoricalVaR(Double prob){
		this.prob = prob;
	}
	public HistoricalVaR(){}

	@Override
	public Double calc(List<CompoundRet> list, Frequency frequency, boolean ifAnnualized) {
		Double historicalVaR= FunctionUtil.HistoricalVaR(prob == null ? Consts.PROB : prob, FunctionUtil.getFundRetList(list));
		return historicalVaR;
	}

}
