Capestone Fundaments 3.3

Hi , even though the badTrades was created as per the requirement still can’t pass the exercise which throws the below error . can that be explained. Or can the requirement be elaborated further.

 

badTrades:select from (update exQuality:classifyTrades[tradeContext`side;tradeContext`price;tradeContext`ask;tradeContext`bid] from tradeContext) where exQuality=0b //your code here - or work in the scratchpad ?Scratchpad

 

 

Hi  here is the expected output (meta, count and first few rows) of badTrades

I get a 'rank error when trying to call your line of code above, classifyTrades should take one parameter which is the table passed to it.

classifyTrades[tradeContext]

If you are still stuck share your definition of classifyTrades and I can better advise.

 

Hi  , I have altered the code to a single input function and getting the desired output as provided above but still i am not able to pass the exercise.

classifyTrades:{ side:xside;price:xprice;ask:xask;bid:xbid; ?[side=`B;?[price<=ask;1b;0b];?[price>=bid;1b;0b]]}
update exQuality:classifyTrades[tradeContext] from tradeContext

badTrades:select from (update exQuality:classifyTrades[tradeContext] from tradeContext) where exQuality=0b

even though i could get the desired output I cannot pass through

Hi  nice this output looks correct to me.

What error are you getting that is stopping you passing?

Hi   this is the error that occurs often

 

You can move the update inside classifyTrades