src/main/java/com/billybyte/marketdata/futures/apos/CalendarSwapAveragePriceInputBlock.java
public static final BigDecimal createRealtimeAveragePrice(
			AveragePriceFutureInfo apfo,BigDecimal[] underlyingPrices){
		double unSettledPrice = 0.0;
		Double[] unsettledWeights = apfo.getUnderlyingUnSettledPercents();
		for(int i = 0;i<underlyingPrices.length;i++){
			if(underlyingPrices[i]!=null){
				unSettledPrice += 
						underlyingPrices[i].doubleValue() * unsettledWeights[i];
			}
		}
		BigDecimal unSettledRealtimePriceAsPercOfAllBusDaysInSwap = 
				new BigDecimal(unSettledPrice).multiply(apfo.getUnSettledPerc());
		int prec = apfo.getUnderlyingSecDefs()[0].getExchangePrecision();
		BigDecimal realTimeAverage = 
				apfo.getPrevAveragedPart().add(
					unSettledRealtimePriceAsPercOfAllBusDaysInSwap).setScale(
							prec,RoundingMode.HALF_EVEN);
		return realTimeAverage;
	}
/**
	 * 
	 * @param apfo
	 * @param underlyingPrices BigDecimal[] array whose size MUST be
	 *         the same size as AveragePriceFutureInfo.underlyingSecDefs.length
	 * @return
	 */
@param apfo
@param underlyingPrices BigDecimal[] array whose size MUST be
the same size as AveragePriceFutureInfo.underlyingSecDefs.length
@return
@param apfo @param underlyingPrices BigDecimal [] array whose size MUST be the same size as AveragePriceFutureInfo . underlyingSecDefs . length @return
public static final BigDecimal createRealtimeAveragePrice(
			AveragePriceFutureInfo apfo,BigDecimal[] underlyingPrices){
		double unSettledPrice = 0.0;
		Double[] unsettledWeights = apfo.getUnderlyingUnSettledPercents();
		for(int i = 0;i<underlyingPrices.length;i++){
			if(underlyingPrices[i]!=null){
				unSettledPrice += 
						underlyingPrices[i].doubleValue() * unsettledWeights[i];
			}
		}
		BigDecimal unSettledRealtimePriceAsPercOfAllBusDaysInSwap = 
				new BigDecimal(unSettledPrice).multiply(apfo.getUnSettledPerc());
		int prec = apfo.getUnderlyingSecDefs()[0].getExchangePrecision();
		BigDecimal realTimeAverage = 
				apfo.getPrevAveragedPart().add(
					unSettledRealtimePriceAsPercOfAllBusDaysInSwap).setScale(
							prec,RoundingMode.HALF_EVEN);
		return realTimeAverage;
	}
public static final BigDecimal createRealtimeAveragePrice ( AveragePriceFutureInfo apfo , BigDecimal [ ] underlyingPrices ) { double unSettledPrice = 0.0 ; Double [ ] unsettledWeights = apfo . getUnderlyingUnSettledPercents ( ) ; for ( int i = 0 ; i < underlyingPrices . length ; i ++ ) { if ( underlyingPrices [ i ] != null ) { unSettledPrice += underlyingPrices [ i ] . doubleValue ( ) * unsettledWeights [ i ] ; } } BigDecimal unSettledRealtimePriceAsPercOfAllBusDaysInSwap = new BigDecimal ( unSettledPrice ) . multiply ( apfo . getUnSettledPerc ( ) ) ; int prec = apfo . getUnderlyingSecDefs ( ) [ 0 ] . getExchangePrecision ( ) ; BigDecimal realTimeAverage = apfo . getPrevAveragedPart ( ) . add ( unSettledRealtimePriceAsPercOfAllBusDaysInSwap ) . setScale ( prec , RoundingMode . HALF_EVEN ) ; return realTimeAverage ; }
@param apfo
 @param underlyingPrices BigDecimal[] array whose size MUST be
         the same size as AveragePriceFutureInfo.underlyingSecDefs.length
 @return
@param apfo @param underlyingPrices BigDecimal [] array whose size MUST be the same size as AveragePriceFutureInfo . underlyingSecDefs . length @return