Currently we can't mix Int64 and Float64 in arithmetic. Let's fix that.
func wavg(ws, vs) = sum(ws * vs) / sum(ws)
from price select vwap = wavg(volume, price) by symbol, bar(time, 5m)
In the above example, volume is an integer and price is a floating point. The weighted-average function will be easy to define without the need for a cast, which the user would have done anyway.
Currently we can't mix
Int64
andFloat64
in arithmetic. Let's fix that.In the above example,
volume
is an integer andprice
is a floating point. The weighted-average function will be easy to define without the need for a cast, which the user would have done anyway.