Trade table added to kdb

Code refactored