cancel
Showing results for 
Search instead for 
Did you mean: 

Capstone Project 3.2 .--Error!!

VM_67
New Contributor II
classify Trades:{[trade Context]trade Context: trade Context, trade Context[`ex Quality]:0b+(trade Context[`side] =`B) *(trade Context[`price] <trade Context[`ask]) +(trade Context[`side] =`S) *(trade Context[`price]>trade Context[`bid]);trade Context}  

 I am getting the output, but one test case is failing. it would be nice if someone could help me.

 

3 REPLIES 3

rocuinneagain
Contributor III
Contributor III

Has something gone wrong with pasting your code in? I assume classify Trades and trade Context should not include those spaces?

Can you edit the question to correct. Also if you have an error can you specify that, it will help people assist you.

 

I would also suggest to use qSQL for this exercise which will make you code much more readable

classifyTrades:{[tradeContext;
 update exQuality:(your logic) from tradeContext
 };

 

One feature that may be useful in solving the question is:

https://code.kx.com/q/ref/vector-conditional/ 

VM_67
New Contributor II

classifyTrades:{[tradeContext]
tradeContext: update exQuality: (price>bid) & (price<ask) from tradeContext;
tradeContext
}

is this correct?

I think u need to take into account buy and sell as well