program Python

Java Python 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 w program、Python hen 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         

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值