1. Front-Running Detector Front-running is defined as trading a stock or another financial asset by a broker who has inside knowledge of a future transaction that is about to affect its price substantially. It is illegal and unethical. Here's an example of front-running: Say a trader gets an order from a broker to buy 50,000 shares of Tesla. Such a huge purchase is bound to drive up the price of the stock immediately, at least in the short term. The trader sets aside the broker request for a minute and first buys some Tesla stock for their own portfolio. Then the broker's order is executed. The trader could then immediately sell the Tesla shares and collect a profit. The trader has made a profit based on information that was not public knowledge. Your task is to create a Front-Running Detector that will process option trade data from different exchanges and determine if front-running has occurred. Your solution should be able to handle data from multiple exchanges, with the expectation that additional exchanges will need to be supported in the future. Your implementation should follow good OOP design practices. Given a trade feed, output a list of all (broker_trade_id, electronic_trade_id) pairs. Trade pairs should be ordered by the electronic trade time. A trade pair is considered front-running if all of the following conditions are met: a. One trade is of type "Broker" and the second trade is of type "Electronic". b. The Electronic trade occurs 1 minute or less before the Broker trade. c. Both trades are for the same product. d. Both trades are of the same type (Call/Put). e. Both trades have the same side (Buy/Sell). f. Both trades have the same expiry date. g. Both trades have the same strike price.
1. Front-Running Detector Front-running is defined as trading a stock or another financial asset by a broker who has inside knowledge of a future transaction that is about to affect its price substantially. It is illegal and unethical. Here's an example of front-running: Say a trader gets an order from a broker to buy 50,000 shares of Tesla. Such a huge purchase is bound to drive up the price of the stock immediately, at least in the short term. The trader sets aside the broker request for a minute and first buys some Tesla stock for their own portfolio. Then the broker's order is executed. The trader could then immediately sell the Tesla shares and collect a profit. The trader has made a profit based on information that was not public knowledge. Your task is to create a Front-Running Detector that will process option trade data from different exchanges and determine if front-running has occurred. Your solution should be able to handle data from multiple exchanges, with the expectation that additional exchanges will need to be supported in the future. Your implementation should follow good OOP design practices. Given a trade feed, output a list of all (broker_trade_id, electronic_trade_id) pairs. Trade pairs should be ordered by the electronic trade time. A trade pair is considered front-running if all of the following conditions are met: a. One trade is of type "Broker" and the second trade is of type "Electronic". b. The Electronic trade occurs 1 minute or less before the Broker trade. c. Both trades are for the same product. d. Both trades are of the same type (Call/Put). e. Both trades have the same side (Buy/Sell). f. Both trades have the same expiry date. g. Both trades have the same strike price.
Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter19: Probabilistic Dynamic Programming
Section19.4: Further Examples Of Probabilistic Dynamic Programming Formulations
Problem 7P
Related questions
Question
PROBLEM IN IN PYTHON 3. THIS IS A CODING PROBLEM.
class Solution:
"""
RAW_TRADE_HEADER = ["trade_id", "trade_date", "time_of_trade", "portfolio", "exchange", "product", "product_type", "expiry_dt", "qty", "strike_price", "side"]
"""
def process_raw_trade(self, raw_trade: List):
def run(self) -> List[Tuple[str, str]]:
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole