[erlang-questions] Market data, trading strategies and dropping the last element of a list

Thomas Lindgren <>
Tue Dec 19 18:55:42 CET 2006


--- Joel Reymont <> wrote:

> The problem I have is what data structure to use for
> quote history  
> accessible by the strategies. There are 3 basic
> operations on the  
> history buffer:
> 
> 1) Collect up to M quotes in the buffer
> 2) Push a new quote into the buffer and drop the
> last quote (push it  
> out)
> 3) Access a quote up to X quotes back

A simple but somewhat nasty solution is to keep the
window in a destructively updated circular buffer,
implemented with an ets table.

Best,
Thomas


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the erlang-questions mailing list