Hi,
I have a table like the following:
r:flip (sym
selectionIdex)!(enlist
1.166515958;enlist 9622749;enlist (atb
atltrd)!(flip (
pricesize)!(1.35 1.01;120.69 7066.74);flip (
pricesize)!(1.38 1.39;252.93 513.43);flip (
price`size)!(1.14 1.15;1575.04 2856.78)));
The method with the adverbs below works fine to pull out the trade prices into a table.
extractPricesSizes:{[x;y] @[@/[;x];;`float$()] each y};
ungroup select sym, selectionId, price:extractPricesSizes[trd
price;ex], size:extractPricesSizes[trd
size;ex] from r
But when the data has the following structure (i.e. with just lists of data instead of tables/dictionaries), I’m struggling to adapt the adverbs to pull out the trade data:
r:flip (sym
selectionIdex)!(
1.1664879041.166487904;7283310 9635244;((
trdltp
tvid)!((2.09 183.12;2.1 1.12;2.08 18.12);2.08;50966.51;7283310f);(
atbtrd
ltptv
id)!(enlist 1.94 46.37;enlist 1.94 551.62;1.94;455408.8;9635244f)));
The relevant snipping of the underlying json for the first structure looks like this: “trd”:[{“price”:1.14,“size”:1575.04},{“price”:1.15,“size”:2856.78},{“price”:1.16,“size”:3944.74}]
The second is like this: “trd”:[[2.08,183.12], [2.08,183.12], [2.08,183.12]]
I’d appreciate any help with this. I can get somewhere if I do this, but it’s not much closer to the answer.
extractPricesSizes:{[x;y] @[@/[;x];;`float$()] each y};
ungroup select sym, selectionId, price:extractPricesSizes[trd;ex], size:extractPricesSizes[
trd;ex] from r
Thanks.