public static BigDecimal calcSMA(List<HistoryRecord> records, int recordIndex, int period) {
		if( records == null || recordIndex < period - 1 )
			return null;
		BigDecimal sum = BigDecimal.ZERO;
		for( int i=0; i<period; i++ ) {
			Record r = records.get(recordIndex - period + 1 + i);
			sum = sum.add(r.getValue());
		}
		
		return sum.divide(new BigDecimal(period), 2, BigDecimal.ROUND_HALF_UP);
	}