/ Given a price history from the public markets and given / a set of trades that you have done, how far off were you / than the public market. n: 30; stocks: `ibm`hp`amaz`goog`aapl; buysell: `buy`sell mytrades:([]stock: n?stocks; side: n?buysell; price: 20 + n?380.0;amount: 100*(1+n?1000); time: 10:00:00.000 + n?01:20:00.000); markettrades:([]stock: n?stocks; price2: 20 + n?380.0;amount2: 100*(1+n?1000); time: 09:00:00.000 + n?02:01:00.000); markettradesordered: `time xasc markettrades; res2: aj[`stock`time;mytrades;markettradesordered] show res2 comply:{[side; inhouseprice; marketprice] if[(side = `buy) & (inhouseprice > marketprice); :`prob]; if[(side = `sell) & (inhouseprice < marketprice); :`prob]; :`noprob } "user defined function" show select stock, time, comply'[side; price; price2] from res2 "all in the where clause" show select stock, time from res2 where ((side = `buy) and (price > price2)) or ((side = `sell) and (price < price2))