public void addTrade(Decimal tradeVolume, Decimal tradePrice) {
        if (openPrice == null) {
            openPrice = tradePrice;
        }
        closePrice = tradePrice;

        if (maxPrice == null) {
            maxPrice = tradePrice;
        } else {
            maxPrice = maxPrice.isLessThan(tradePrice) ? tradePrice : maxPrice;
        }
        if (minPrice == null) {
            minPrice = tradePrice;
        } else {
            minPrice = minPrice.isGreaterThan(tradePrice) ? tradePrice : minPrice;
        }
        volume = volume.plus(tradeVolume);
        amount = amount.plus(tradeVolume.multipliedBy(tradePrice));
        trades++;
    }
public void addTrade(Decimal tradeVolume, Decimal tradePrice) {
        if (openPrice == null) {
            openPrice = tradePrice;
        }
        closePrice = tradePrice;

        if (maxPrice == null) {
            maxPrice = tradePrice;
        } else {
            maxPrice = maxPrice.isLessThan(tradePrice) ? tradePrice : maxPrice;
        }
        if (minPrice == null) {
            minPrice = tradePrice;
        } else {
            minPrice = minPrice.isGreaterThan(tradePrice) ? tradePrice : minPrice;
        }
        volume = volume.plus(tradeVolume);
        amount = amount.plus(tradeVolume.multipliedBy(tradePrice));
        trades++;
    }
public void addTrade ( Decimal tradeVolume , Decimal tradePrice ) { if ( openPrice == null ) { openPrice = tradePrice ; } closePrice = tradePrice ; if ( maxPrice == null ) { maxPrice = tradePrice ; } else { maxPrice = maxPrice . isLessThan ( tradePrice ) ? tradePrice : maxPrice ; } if ( minPrice == null ) { minPrice = tradePrice ; } else { minPrice = minPrice . isGreaterThan ( tradePrice ) ? tradePrice : minPrice ; } volume = volume . plus ( tradeVolume ) ; amount = amount . plus ( tradeVolume . multipliedBy ( tradePrice ) ) ; trades ++ ; }
Adds a trade at the end of tick period.
@param tradeVolume the traded volume
@param tradePrice the price
Adds a trade at the end of tick period .