public TreeMap<Integer, Double> ma(String p_day, ArrayList<Integer> days, int pre_days) {
		
		double sum = 0;
		int count = 0;
		int i = 0;  //处理到的均线坐标
		
		TreeMap<Integer, Double> maret_map = new TreeMap<Integer, Double>();
		
		
		for (String day : stock_price.headMap(p_day, true).descendingKeySet().toArray(new String[0])) {
			
			if (pre_days > 0) {
				pre_days--;
				continue;
			}
			
			PriceRecord pr = stock_price.get(day);
			sum += pr.close;
			count++;
			
			// 循环处理每个均线周期
			if (count == days.get(i)) {
				maret_map.put(count, sum / count);
				i++;
				// 所有给定周期已经计算完，则退出
				if (i == days.size()) {
					break;
				}
			}
		}
		
		//补全时间不足的返回结果
		while (i < days.size()) {
			maret_map.put(days.get(i), 0.0);
			i++;
		}
		
		for (Integer day : maret_map.keySet()) {
			log.debug(day.intValue() + "->" + maret_map.get(day));
		}
		
		return maret_map;
	}