money.rave.common.backend.expression.operator.Multiply.kt Maven / Gradle / Ivy
package money.rave.common.backend.expression
import money.rave.common.backend.expression.EvaluationContext
import money.rave.common.backend.expression.Expression
import money.rave.common.backend.scaledBigDecimal
import java.math.BigDecimal
class Multiply(
children: List>,
private val defaultCandleIndex: Int = 0,
) : Operator(children) {
override fun evaluate(context: EvaluationContext, candleIndex: Int): BigDecimal {
var value = 1.scaledBigDecimal()
for (child in children) {
value *= child.evaluate(context, defaultCandleIndex + candleIndex)
}
return value.scaledBigDecimal()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy