public MacdRet macd(String p_day) throws ParseException {
		int p_long = 26;
		int p_short = 13;
		int p_m = 9;
		
		ArrayList<Double> close_list_long = GetPriceArray(p_day, p_long);
		ArrayList<Double> close_list_short = GetPriceArray(p_day, p_short);
		
		MacdRet mr = new MacdRet();
		
		double a13 = ema(close_list_short, p_short, p_short);
		double a26 = ema(close_list_long, p_long, p_long);
		
		mr.diff = a13 - a26;
		log.debug("macd, diff:" + mr.diff + ", ema13:" + a13 + ", ema26:" + a26);
		
		//计算9天的DIFF，为计算DEA准备数据（需要剔除掉非交易日的数据）！！！！
		ArrayList<Double> diff_list = new ArrayList<Double>();
		DateFormat format = new SimpleDateFormat("yyyyMMdd");
		Date date = format.parse(p_day);
		int count = 0;
		int i = 0;
		double last_diff = 0;
		while (true) {
			long tm = (date.getTime() / 1000 - i * 24 * 60 * 60) * 1000;
			Date tmp_date = new Date(tm);
			String tmp_day = format.format(tmp_date);
			
			if (stock_price.containsKey(tmp_day)) {
				close_list_long = GetPriceArray(tmp_day, p_long);
				close_list_short = GetPriceArray(tmp_day, p_short);
				
				a13 = ema(close_list_short, p_short, p_short);
				a26 = ema(close_list_long, p_long, p_long);
				
				double diff = a13 - a26;
				log.debug(tmp_day + ":" + diff);
				//保留三位小数
//				BigDecimal bg = new BigDecimal(diff);
//		        diff = bg.setScale(2, BigDecimal.ROUND_DOWN).doubleValue();
				diff_list.add(diff);
				last_diff = diff;
				
				count++;
				if (count >= p_m || stock_price.firstKey().equals(tmp_day)) {
					break;
				}
			}
			i++;
		}
		
		while (count < p_m) {
			log.debug("add" + last_diff);
			diff_list.add(last_diff);
			count++;
		}
		
		Collections.reverse(diff_list);
		mr.dea = ema(diff_list, p_m, p_m);
		
		mr.macd = 2 * (mr.diff - mr.dea);
		log.debug("macd, diff:" + mr.diff + ", dea:" + mr.dea + ", macd:" + mr.macd);
		
		return mr;
	}