cancel
Showing results for 
Search instead for 
Did you mean: 

Fundamentals Capstone 5.2

danritch
New Contributor

I cant seem to fix the type error on the 2nd part of question 5 my code looks like this,

 

avgtrdata : select avgEdge by option_id from optProfile

select edge,avg avgEdge by option_id from latesttrds ij avgtrdata where edge > avgEdge

 

I gave up with the fby for now as I was getting the same type errors but it seems when I am using the "by" command in SQL the data type changes from 32 to 64 bit or lowercase to uppercase on the meta of the table and this means that it is no longer comparable with the > symbol.

Any help would be appreciated thanks,

Dan

10 REPLIES 10

danritch
New Contributor

UPDATE:

I now have this which works,

edgeProfile: select numTrds:count i, avgEdge: avg edge, minQty:min qty, maxQty:max qty by option_id from latesttrds where edge <(avg;edge) fby option_id

However it fails the test... any help would be great my output table looks like this,

Screenshot 2023-10-31 at 16.08.29.png

megan_mcp
Community Manager Community Manager
Community Manager

Hi @danritch,

Can you send the code for the table latesttrds please?

Thanks,

Megan 🙂

Thanks for the reply,

latesttrds: select from trade where date = 2020.08.06

was just a way of selecting only the last day and not having to worry about it.

thanks,

Dan

megan_mcp
Community Manager Community Manager
Community Manager

Hi @danritch,

As you can see in the screenshot provided below the question asks to include trades where the edge collected was greater than the average edge collected by that option.

If you adjust this, it should work fine.

Thanks,

Megan 🙂

Amazing, I apologise that was a silly error however on a very similar note, I thought that would fix the fail for the values on 5.3, unfortunately, it hasn't.

My code looks like this,

optinstRef: optRef ij select by inst_id from instRef

edgeProfileFull: select numTrds, avgEdge, minQty, maxQty, inst_id, opt_type, strike, expiry, inst_syb, inst_name by option_id from edgeProfile ij select by option_id from optinstRef

and my table top row matches the one printed in the work book,

Screenshot 2023-10-31 at 16.47.19.png

Any final help would be amazing on this,

Thanks Dan 

For further reference this is the data types in the table,

Screenshot 2023-10-31 at 17.36.25.png

 

megan_mcp
Community Manager Community Manager
Community Manager

Can I ask you to send the fail message you are getting? I've ran your code and it seems to work fine.

Thanks,

Megan

Screenshot 2023-10-31 at 18.13.36.png

Thanks for the reply there is actually no message it just says it has failed and I cant submit.

 

Thanks,

Dan

Just to add i restarted everything and reran it but it seems to still fail without an error message,

megan_mcp
Community Manager Community Manager
Community Manager

Hi @danritch,

Sorry for the delay in this response, the majority of the columns in your edgeProfileFull table are in the wrong format and I feel this has something to do with your code leading up to creating this table.

Can I ask you to download your notebook and send it to me at mmcparland@kx.com so I can have a better look? 

Thanks,

Megan