联系方式

您当前位置:首页 >> Python编程Python编程

日期:2024-08-19 07:53

Problem

Our US stock trading system records all our trades in a log file at the end of a

trading day. Since trades are critical information, to ensure the correctness we

also obtain from our execution broker their copy of our trades of that day, and

compare (i.e. reconcile) the two sources. Trading support staff run this

reconciliation every day and perform troubleshooting if discrepancies are

found.

We expect a 1-to-1 match between our copy of trades and broker’s copy of

trades, unless occasional errors occur causing missing trades. Two matched

trades are expected to have the same security symbol, same side (buy or sell),

same price, and same quantity (in shares). However, since two parties may

receive a trade at slightly different time, the timestamp of two trades may not

perfectly match, and a small difference (for example 1 second) should be

tolerated. The ordering of trades in two sources might not be identical.

Our copy of trades is saved in a gzip file. Each line in the file is a json dictionary

representing a trade. The key attributes security symbol, side, price, quantity

are respectively called “symbol”, “fill_side”, “fill_px”, “fill_qty”. For fill_side, 0

means buy and 1 means sell.

The broker’s copy of trades is a csv file. The key attributes security symbol, side,

price, quantity are respectively called “SYMBOL”, “SIDE”, “TOTAL_EXEC_QTY”,

“LAST_PX”.

Pay attention to the time zone conventions when you interpret the timestamp

in each file.

See below links for a sample of one day’s data:

 Our copy of trades:

https://scientech-pubtraining.s3.amazonaws.com/coding_test_trade_recon/txn.log.gz


 Broker’s copy of trades: https://scientech-pubtraining.s3.amazonaws.com/coding_test_trade_recon/EOD_Executions_

20210104.csv

Requirment

1. Write a computer program (preferably in Python) to automatically

reconcile trades from these two sources. The program should at minimum

print out the unmatched trades from each source. If you have extra time,

consider adding the feature of producing human friendly report in html

format that can be embedded in notification email.

2. Use this program to reconcile the sample dataset, and document your

findings.

Non-disclosure Agreement (NDA)

Confidential Information

The content of the coding test ("Test"), including questions, answers or any

communication, regarding or related to the Test is Scientech Research’s

confidential information ("Confidential Information"). You are expressly

prohibited from disclosing, publishing, posting or selling any Confidential

Information, in whole or in part, in any form or by any means, oral or written,

electronic or mechanical, for any purpose. The submission of the Test

expresses and constitutes your entire understanding with respect to the

subject matter of this Non-disclosure Agreement.


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:821613408 微信:horysk8 电子信箱:[email protected]
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:horysk8