VM_671
1
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.
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_671
3
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