How would you write complex window functions in SQL for time-series analysis at Balyasny Asset Management?