-
help with VWAP function
Hi, as a small exercise, i am trying to compute the VWAP over the different depths of the order book.The simplest way is select timestamp, depth_vwap1: (bq0; bq1; aq0; aq1) wavg (bp0; bp1; ap0; ap1) from data now i am trying to abstract i in a function so that we can pass the max depth the vwap goes to as a parameter:
[!data; (); 0b; (enlist$ "vwap_d", string max_depth)!(enlist(wavg;(enlist;bq0;bq1;aq0; aq1 ); (enlist;bp0;bp1;ap0; ap1 )))]
now, i need to abstract the
(enlist;bp0;bp1;ap0;ap1)
part.I thought of doing :
quantities: raze(("bq"; "aq"),/::string til maxDepth) prices : raze(("bp"; "ap"),/::string til maxDepth)
but then i dont understand how to use them within the parse request.Would really appreciate is someone could help!Thank youPaul
edit: sorry for the formatting i dont know what causes that
- This discussion was modified 2 weeks, 4 days ago by mwoods.
- This discussion was modified 2 weeks, 3 days ago by mwoods.
- This discussion was modified 1 day, 20 hours ago by supportelearningwp-com.
Log in to reply.