📣 黑五价提前开抢|VIP一年通行证5折,蓝莓、Offer多多同步特惠
12
返回列表 发新帖
楼主: 可爱小奶昔
跳转到指定楼层
上一主题 下一主题
收起左侧

[应届生NG] SIG Quantitative Strategy Developer Onsite

🔗
暗夜思潮 2026-7-10 04:16:25 | 只看该作者
全局:
DanZLCU 发表于 2025-9-17 17:58
求交流data exercise和onsite考的是什么?谢谢!

求问data exercise考的90分钟的那种pandas数据处理吗~?请问考了些什么呀~ 多谢多谢!!
回复

使用道具 举报

全局:
暗夜思潮 发表于 2026-07-09 13:16:25
求问data exercise考的90分钟的那种pandas数据处理吗~?请问考了些什么呀~ 多谢多谢!!
# Trade Data Exercise

You are going to explore and analyze stock market data and trades done by some trading strategy over a historical two-month period.  We've provided three CSV file datasets and some helper code to load the data into pandas dataframes.  You are free to refer to any external documentation you need while working on these problems. Let's look at the data:
..
### Market Data
. 1point 3acres
The first data set contains two months of market data for a set of US equity symbols, with data aggregated by minute.  It's columns are:.google  и
- symbol: string, the equity symbol
- time_ns: int64, the unix epoch time in nanoseconds (a note about how to work with this field is below)
- trade_count: int, the total number of trades in the symbols over the previous minute (before time_ns). 1point3acres.com
- volume: int, the total number of shares traded in that minute
- dollar_volume: float, the dollar volume of trades in that minute (the dollar volume of a trade is shares * price)
- last_trade: float, the price of the last trade that happened before time_ns

For your convenience we have translated the time_ns column into date and time columns which you may find useful later on

import pandas as pd

data_dir = 'data'

market_data = pd.read_csv(data_dir + '/history_1.csv')

def add_date_and_time_columns(df):
    datetime = pd.to_datetime(df.time_ns)
    local_datetime = pd.Series(datetime.array.tz_localize('UTC').tz_convert('US/Eastern'))
    df['time_of_day'] = local_datetime.dt.time
    df['date'] = local_datetime.dt.date. Waral dи,

add_date_and_time_columns(market_data)
market_data
### Reference Data. Waral dи,

The next file provides equity-specific data, just the sector in which the equity belongs.
. 1point3acres.com
- symbol: string, the equity symbol
- sector: string, the market sector of the equity, e.g. bank, tech, energy
ref_data = pd.read_csv(data_dir + '/refdata_1.csv')
ref_data
### Strategy Trade Data
.--
The final data set contains a history of trading done by some strategy.  Columns are:. Waral dи,

- symbol: string, the equity symbol
- time_ns: int64, the unix epoch time when the trade occured
- shares: int, how many shares the strategy bought or sold
- price: float, the price of the transaction. 1point3acres.com
- buy: boolean, true if the strategy bought, false if sold. 1point3acres.com
strategy_trades = pd.read_csv(data_dir + '/trades_1.csv')
add_date_and_time_columns(strategy_trades)
strategy_trades
## Market Trade Analysis - By Symbol
. ----
Let's look at the trades that happened in the market (not the strategy's trades - you do not need the strategy_trades table for these first questions!).

Build a dataset that captures per symbol:
- total trade count
- total share volume
- total dollar volume
- average daily trade count
- average daily share volume
- average daily dollar volume
- percent of total dollar volume represented by that symbol (sum across all symbols should be 100)

Sort and display this dataset from largest average daily dollar volume to smallest
. From 1point 3acres bbs
## Market Trade Analysis - By Sector

Repeat the above but build a data set with one row per sector instead of symbol

## Strategy Analysis - Look-ahead prices

Now let's bring the strategy_trades dataset into the mix.

We want see how each trade fared (its profit or loss) at some time in the future.  Specifically we are interested in these time horizons from the time of the trade. .и

- 5 minutes. 1point 3acres
- 10 minutes-baidu 1point3acres
- 15 minutes
- 30 minutes
- 60 minutes

First, write a function that determines the price some minutes in the future for each row of the strategy_trades dataset.  Then use that function to create price_min5, price_min10, ..., price_min60 columns in the strategy_trades table.  Use the market_data dataset with its one-minute last_trade prices as the source for the look-ahead prices.

## Strategy Analysis - Profit and Return

For each horizon we want
.
- profit or loss in dollars for the trade (for buys this is: (size of trade)(lookahead_price - trade_price) )
- basis points of return for the trade (for buys this is 10000 * (lookahead_price - trade_price) / trade_price). Waral dи,

Create profit_min5, profit_min10, ... profit_min60, and bpreturn_min5, bpreturn_min10, ..., bpreturn_min16 columns in the strategy_trades_dataset
.
## Strategy Analysis - Daily Profits. Χ

For each sector and date, calculate the total profit at each time horizon.

## Strategy Analysis - Plot Cumulative Profit

In one plot, show the _cumulative_ 10-minute profit for each sector across dates - x-axis is date, y-axis is sum of all profits up to and including that date. 1point3acres

## Strategy Analysis - Open Ended

Is there something you can say or show that highlights different trading outcomes (in terms of basis-point return statistics) in the sectors based on time of day of the trades

评分

参与人数 1大米 +1 收起 理由
暗夜思潮 + 1 很有用的信息!

查看全部评分

回复

使用道具 举报

🔗
暗夜思潮 2026-7-14 03:42:42 | 只看该作者
全局:
timothly_black 发表于 2026-7-13 11:45
# Trade Data Exercise. Waral dи,

You are going to explore and analyze stock market data and trades done by so ...

wow同学,万分感谢!!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表