WindowJoin

I have a table full of trades, and a table full of quote updates. My  goal is to use a windowjoin to get aggregate figures – however I have an extra parameter that I need to pay attention too (usually coming from the trades table). 

Thus, I’ve been using select function’[thingfromtrades,stuff,stuff2] from wj[w;c;trades;(quotes;(::;stuff);(::;stuff2))];. 

Within FUNCTION I’m literally just taking everything and creating a table to do a search with the extra param from tradestab.

Naturally there has to be a better way…

Any help appreciated!

Hi ticktick,

  1. You could feed a table directly to the function:

select function[(thingfromtrades;stuff;stuff2)] from wj[w;c;trades;(quotes;(::;stuff);(::;stuff2))];  

  1. You also could put your own aggregation functions in the wj:

wj[w;c;trades;(quotes;({neg avg x};stuff);({neg avg x};stuff2))]  

  1. If possible, 2 ajs at the start and end of the window with aggregations can be faster than wj.

Regards,

Matt M