I want an EPL query to calculate a moving window price velocity, and am having a hard time piecing correctly. The velocity would be calculated as price in last event in moving window minus price in first event in moving window, divided by length of window in seconds. Something along the the lines of:
select Bid from MarketData(instrument='XYZ').win:time(10)(=>(.last() - .first())/10)
any help in correcting the query is much appreciated