2022.09.26 08:45 AM
Hi all,
I fail in a test case on exercise 3.1 "tradeContext Has Correct Format", test report as below:
testSection[`exercise3]
quizItem success description error
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
exercise3.1 Pass "tradeContext Is Defined In Process" ""
exercise3.1 Fail "tradeContext Has Correct Format" ""
exercise3.3 Pass "badTrades Is Defined In Process" ""
exercise3.3 Fail "bad Trades Has Correct Format" ""
exercise3.4 Fail "abort" "abort in before block due to error \"/developer-1.5.0-linux/workspace/__nouser__/funds_capstone/badTrades.csv. OS reports: No such file or directory\""
i cross-checked with the project description, seems everything looks good.
(example from project description)
date | option_id | trade_id | time | price | qty | side | edge | exch_id | broker_id | bid | ask |
---|---|---|---|---|---|---|---|---|---|---|---|
2020.08.06 | FB20200720C230 | "258" | 13:01:30.268 | 22.82637 | 99 | S | -230.8243 | 4 | 705 | 44.55 | 45.9 |
2020.08.06 | KO20201120P55 | "142" | 10:52:10.106 | 55.65839 | 68 | B | 172.7843 | 3 | 703 | 77.74 | 78.74 |
meta tradeContext (tradeContext's schema)
c | t f a
---------| -----
date | d
option_id| s
trade_id | C
time | t
price | f
qty | j
side | s
edge | f
exch_id | j
broker_id| j
bid | f
ask | f
5#tradeContext (sample data)
date option_id trade_id time price qty side edge exch_id broker_id bid ask
---------------------------------------------------------------------------------------------------------
2020.08.03 FB20200720C230 "37" 09:40:54.492 22.89417 27 B 48.54252 3 708 22.66 23.04
2020.08.03 FB20200720C230 "74" 10:00:36.511 20.99512 94 B 363.9133 4 708 20.88 21.44
2020.08.03 FB20200720C230 "113" 10:25:05.502 5.925473 26 S -18.60517 4 703 5.89 6.18
2020.08.03 FB20200720C230 "185" 11:28:44.556 27.83063 94 B 104.0323 4 705 27.81 28.1
2020.08.03 FB20200720C230 "275" 13:13:27.811 76.05747 38 B -3.428841 3 705 75.96 76.2
I have no idea which columns go wrong, anyone can give me some hits?
Thanks.
Franky
2022.09.27 02:42 AM - edited 2022.10.01 05:58 AM
Dear all,
I fixed it.
for those who encounter the same issue, there is the correct schema:
meta tradeContext
c | t f a
---------| -----
date | d
option_id| s p
trade_id | C
time | t
price | f
qty | j
side | s
edge | f
exch_id | j
broker_id| j
bid | f
ask | f
good luck
2023.07.13 05:32 AM - edited 2023.07.13 05:44 AM
t:select from trade
n:select date,option_id,time,bid,ask from nbbo
meta tradeContext:aj[`date`option_id`time; t;n]
tradeContext:`option_id xkey tradeContext
5#tradeContext
option_id | date trade_id time price qty side edge exch_id broker_id bid ask
--------------| ------------------------------------------------------------------------------------------
FB20200720C230| 2020.08.03 "37" 09:40:54.492 22.89417 27 B 48.54252 3 708 22.66 23.04
FB20200720C230| 2020.08.03 "74" 10:00:36.511 20.99512 94 B 363.9133 4 708 20.88 21.44
FB20200720C230| 2020.08.03 "113" 10:25:05.502 5.925473 26 S -18.60517 4 703 5.89 6.18
FB20200720C230| 2020.08.03 "185" 11:28:44.556 27.83063 94 B 104.0323 4 705 27.81 28.1
FB20200720C230| 2020.08.03 "275" 13:13:27.811 76.05747 38 B -3.428841 3 705 75.96 76.2
meta tradeContext
c | t f a
---------| -----
option_id| s
date | d
trade_id | C
time | t
price | f
qty | j
side | s
edge | f
exch_id | j
broker_id| j
bid | f
ask | f
quizItem success description error
--------------------------------------------------------------
exercise3.1 Pass "tradeContext Is Defined In Process" ""
exercise3.1 Fail "tradeContext Has Correct Format" ""
exercise3.3 Pass "badTrades Is Defined In Process" ""
exercise3.3 Pass "bad Trades Has Correct Format" ""
exercise3.4 Pass "badTrades Is Saved In Correct Dir" ""
exercise3.4 Pass "Contents Of CSV File Is Correct" ""
Please help me on this.
2023.07.13 08:01 AM
2023.07.13 09:00 AM
I tried to update the schema with below
tradeContext:`option_id xkey tradeContext
but still the meta shows it with out key
meta tradeContext
c | t f a
---------| -----
option_id| s
date | d
trade_id | C
time | t
price | f
qty | j
side | s
edge | f
exch_id | j
broker_id| j
bid | f
ask | f
2023.07.14 05:44 AM
Thanks a ton, was making a silly mistake of duplicate records.
It's sorted now.
2023.08.14 05:47 AM
Hi @ashish31 , It seems like exercise 3.3 is completed but all i get is a type error . can you share the perspective of how the exercise can be done.
2023.08.14 06:02 AM
@Subhashchander Can you please share your definition of classifyTrades and meta of table?
2023.08.14 06:06 AM
Hi @ashish31 ,
classifyTrades:{[x] side:x`side;price:x`price;ask:x`ask;bid:x`bid;?[side=`B;?[price<=ask;1b;0b];?[price>=bid;1b;0b]]};
badTrades:select from (update exQuality:classifyTrades[tradeContext] from tradeContext) where exQuality=0b;
this is the meta of TradeContext table i used in the function.
These are the query that i used for the exercise ..where did i go wrong is unknown .
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.