title: Esper EPL query for calculating price velocity in a moving window
body: <p>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:</p>
  
  <pre><code>select Bid from MarketData(instrument='XYZ').win:time(10)(=&gt;(.last() - .first())/10)
  </code></pre>
  
  <p>any help in correcting the query is much appreciated</p>