cancel
Showing results for 
Search instead for 
Did you mean: 

Sliding window

joelr1
New Contributor
Mime-Version: 1.0 (Apple Message framework v919.2)Subject: Sliding windowDate: Wed, 9 Apr 2008 12:48:47 +0100X-Mailer: Apple Mail (2.919.2)How do you implement a sliding window?Assume that you need to take a movingaverage over the last 10 quotes. Yournew arriving ticks keep going to theend of the array, right?You can easily take the first N itemsor drop the first N items. Do you dropall the items but the last N you needto arrive at the sliding window?Is that efficient? Thanks, Joel--wagerlabs.com
1 REPLY 1

Aaron_Davies
New Contributor
you could do the same to the indices instead if you're worried about speedOn Wed, Apr 9, 2008 at 7:48 AM, Joel Reymont wrote:>> How do you implement a sliding window?>> Assume that you need to take a moving> average over the last 10 quotes. Your> new arriving ticks keep going to the> end of the array, right?>> You can easily take the first N items> or drop the first N items. Do you drop> all the items but the last N you need> to arrive at the sliding window?>> Is that efficient?>> Thanks, Joel>> --> wagerlabs.com>>>>>>> >>-- Aaron Daviesaaron.davies@gmail.com