All Questions
Next Question
Most Profitable Strategy
00:00:00
Parts
Part 1
A quantitative hedge fund consists of a team of 35 traders. These traders execute trading strategies that fall into one of four categories: 'momentum', 'trend', 'mean reversion', and 'stat arb'.
Using the tables given below, for each trader that has made at least 5 trades of the same strategy in the past week, find their most profitable trading strategy and the profit they earned from that strategy. If more than one strategy is equally profitable, return the first trading strategy deployed. Output the trader's name, trading strategy and total profit. Sort the result by profit in descending order and name in ascending order
Example Output:
full_name | strategy | total_profit |
---|---|---|
Brian Hu | momentum | 7500 |
John Doe | trend | 3300 |
Michael Lewis | stat arb | 3300 |
Samuel Wellington | momentum | 1000 |
Tables:
traders
Column Name | Data Type |
---|---|
trader_id | bigint |
first_name | text |
last_name | text |
text | |
age | int |
joined_company_dt | datetime |
trade_results
Column Name | Data Type |
---|---|
trade_id | bigint |
trader_id | bigint |
trade_execution_dt | datetime |
profit | bigint |
strategy | text |