2023.02.08 12:22 AM
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.
2023.02.08 01:34 AM
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:
2023.02.08 03:29 AM
classifyTrades:{[tradeContext]
tradeContext: update exQuality: (price>bid) & (price<ask) from tradeContext;
tradeContext
}
is this correct?
2023.03.02 05:44 PM
I think u need to take into account buy and sell as well
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.