0% found this document useful (0 votes)
16 views9 pages

Inter IIT Tech Meet 14.0: Quant Strategy

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views9 pages

Inter IIT Tech Meet 14.0: Quant Strategy

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

INTER IIT

TECH MEET 14.0


PREPATHON PS

QUANT
CM: Krishnav Bajoria (87777 29084)
and Hardik Sharma ( 6284 825 371)

PREPATHON 2025 | IIT(BHU)


1. PROBLEM STATEMENT 1
This PS is specifically designed keeping in mind the requirements for Low Prep PS.

1.1. Objective
The goal of this exercise is to assess your ability to implement and evaluate a
quantitative trading strategy from a detailed specification. This will involve handling
time-series data, applying trading logic in a vectorized manner, managing portfolio
state, and generating a clear performance report.

1.2. Strategy Overview


You are tasked with creating a market-neutral, long-short strategy that trades a universe
of stocks.
The strategy rebalances on an hourly basis, taking long positions in stocks that have
performed the best over the previous hour and short positions in stocks that have
performed the worst. This is a classic short-term momentum (or “relative strength”)
strategy.

1.3. Detailed Requirements


1.3.1 Asset Universe
• Assets: Constituents of the S&P top 300 Index.
• You will need to source a list of these symbols. A static list from a specific point in
time is acceptable for this exercise.

1.3.2 Data
• Dataset link: Here Use Institute Mail)
• Type: 1-minute intraday price data Open, High, Low, Close, Volume) for all stocks
in the asset universe.
• Time Period: A minimum of 2 full calendar years (e.g., January 1, 2023, to
December 31, 2024.
• Data Sourcing: You may use the data source provided to you.

Strategy Logic The Algorithm)


The strategy must be executed precisely as follows:
1. Rebalancing Frequency: The portfolio is rebalanced at the top of every hour
during market hours (e.g., 930 AM, 1030 AM, 1130 AM, 1230 PM, 200 PM, 300
PM ET.
2. At each rebalancing time, perform the following steps:

QUANT 1
(a) Liquidate all positions: Close any existing long or short positions from the
previous hour at the current market price.

(b) Calculate Signal: For every stock in the universe, calculate its return over the
preceding hour.
Example: For the 1000 AM rebalance, the signal is the return from 900 AM to
1000 AM, calculated as (P10:00 /P09:00 ) − 1.

(c) Rank Stocks: Rank all stocks from highest to lowest based on their calculated
1-hour return.

(d) Form Portfolios:

• Long Portfolio: Identify the top 10% of stocks (the highest returns).

• Short Portfolio: Identify the bottom 10% of stocks (the lowest


returns/biggest losers).

(e) Position Sizing:

• Assume a starting portfolio capital of $1,000,000.

• The strategy must be market-neutral. Allocate 100% of the capital to the


long side and 100% of the capital to the short side (i.e., $1,000,000 long
and $1,000,000 short for a gross exposure of $2,000,000.

• Positions within each portfolio (long and short) should be equally


weighted.

(f) Execute Trades: Enter new long and short positions based on the portfolios
formed in step 4.

(g) Hold: Hold these new positions for exactly one hour until the next rebalancing
time.

1.3.3 Assumptions & Simplifications


• Trading Hours: Assume standard US market hours 930 AM to 400 PM ET. The
first rebalance can occur at 1030 AM (based on the 930–1030 return).

• Transaction Costs: To simulate realism, assume a combined cost (slippage +


commission) of 10 basis points 0.05% on the value of every trade.

1.4. Expected Deliverables


• Backtesting Script: A clean, well-commented Python script that implements the
strategy logic.

• Trade Log CSV

– A CSV file (trade_log.csv) detailing every trade executed by the strategy.

2 QUANT
– Required columns: timestamp, symbol, side LONG/SHORT, entry_price,
exit_price, quantity, pnl, pnl (percentage).

2. Problem Statement 2
You are required to do two tasks for qualification for the Inter IIT Quant High Prep Team.

Task 1 The first task is to become a WorldQuant Research Consultant. Further create 3
spectacular alphas with a sharpe ratio of greater than 2 on the WorldQuant BRAIN
platform and submit them in the google form with their settings as you have configured.

Task 2 Complete the second task given below.

Dataset Link: Google DriveUse Institute Mail only)

2.1. Introduction
When you choose to buy or sell an asset, you can place two main types of orders: a
market order and a limit order. The mechanics of the two order types are very different
in nature; here we explain how it works:

• A limit order allows you to buy or sell an asset at a predetermined price. Given that
you have to wait in a queue; the first orders that join the limit order book is
executed first in a FIFO style queue. Benefit/Drawback : You are able to execute
an order at the price you want, but you have to wait for orders in front of you to
execute first. Sometimes you wait 1 second, 1 minute or ... for eternity (will explain).

• A market order allows you to buy or sell an asset immediately, but the price is
variable depending on the available liquidity. Benefit/Drawback : You are able to
execute an order immediately, but at a price you can’t decide.

Let us look at the dynamics of the two more closely in this example scenario (this is a
dummy scenario not indicative of a true market!

Consider an empty exchange for a stock called BLOCKHOUSE. Currently there is no one
in the exchange.

At time 900 a seller joins the market, they place an ask-side limit order at a price of
$9.00 for a quantity of 10 shares. This means they are willing to wait in the queue (which
is empty right now) to sell 10 shares of the asset at a price of $9.

At time 901 a buyer joins the market, they place a bid-side limit order at a price of $8.90
for a quantity of 20 shares. This means they are willing to wait in the queue (which is
empty right now) to buy 20 shares of the asset at a price of $8.90.

At this instant we can create a snapshot of the limit order book.

QUANT 3
Fig. 1 Snapshot at 901

Now at 902 another buyer joins at $ 8.85 with 13 shares and another seller joined at
$9.05 with 8 shares. We have depths to the limit order book!

Fig. 2 Snapshot at 902

At this time all the orders so far are still waiting! This is why we wait when we place limit
orders. How do we get an execution? Suppose that at 903 someone joins the market,
very eager to buy 8 shares.

4 QUANT
Fig. 3 Snapshot at 903

They place a buy-side market order for 8 shares, immediately their order get satisfied.
How? Their orders are now matched with the cheapest ask-side limit orders! The
best-ask queue drops from 10 to 2, the person who placed their orders at $9.00 now
sees that 8 of their orders are filled at $9.00 (they sold 8 shares at $9.00 and the trader
who placed the market order bought 8 shares at a relatively expensive $9.00.

Now, what we do is we log slippage, it describes how much ”worse” it costed you to
execute your order with respect to the mid price. For the limit order trader their slippage
was $8.95 $9.00 = $0.05 , they were able to sell for 5 cents more than the mid price.
While the market order trader has the slippage of $9.00 - $8.95 = $0.05, they had to
buy the asset at 5 cents more expensive than the mid price. Sometimes your slippage
can be very high.

For example, let us suppose that at 904 a trader comes in and places a market order to
sell the asset at a quantity of 30 shares. Notice that the best-bid level only has 20
shares, so his order of 30 will be split into: 20 shares at $8.90 and 10 shares at $8.85.
Their slippage is now 208.958.90108.958.85 = $0.067. This is because they
eat into the second level, the order book now looks like this:

QUANT 5
Fig. 4 Snapshot at 904

This should be sufficient to understand the basic workings of an order book, what limit
and market orders are, and how we compute slippage.

Note: Recall that we said sometimes you wait for an eternity if you place limit orders.
This can happen if you place an order at a price that is too high or too low (depending
on if you sell or buy) and the price drifts away from you never to return.

2.2. Problem Statement


Let us define the temporary impact function gt(X) as the amount of slippage you incur if
you place X orders at the current time t. For example, consider the following limit order
book data:
Price Ask Size Bid Size
$81.00 140
$80.99 123
$80.97 110
$80.96 SPREAD
$80.95
$80.93 112
$80.92 138
$80.91 200

For this order book state, the best bid is $80.93, the best ask is $80.97, the spread is
$0.04. The amount of orders in each limit order price is specified in red (ask) and green
(bid). The temporary impact function at that instant would look like this:

6 QUANT
Fig. 5 Buy Side (Ask) temp impact

Fig. 6 Sell Side (Bid) temp impact

Let us suppose that we have S total amount of orders to be bought, you are given how
many shares S to buy before market opens, and must buy exactly S shares by end of
day. You are tasked with creating a strategy that is supposed to minimize the total
temporary impact of the executed orders. Mathematically speaking, let gt(X) be the
temporary impact function at some time t. Let us split the day into N trading periods. Let
x ∈ RN be your allocation vector (we generally have to take integer quantities but real
numbers are okay for now) where you choose to buy xi shares at the ith period. Given
data for N = 390 (one minute trading window) and data for 3 stocks. Please answer the
following questions:

• How do you choose to model the temporary impact gt(x)? For exam- ple,
sometimes people try to ”linearize” the model gt(x) ≈ βtx. If you think linear models
are gross oversimplifications, how would you model it? Please write a 12 page
explanation on your model, using data from the 3 tickers provided. We understand
that 3 tickers is not enough data so any valid reasoning/conclusions derived from

QUANT 7
these 3 tickers would be accepted. Please also attach a link to a python notebook
or code (pref ably uploaded on GitHub) where you conducted your analysis.
• Formulate roughly but rigorously a mathematical framework / algorithm that gives
us xi when we are at time ti. Make sure that xi = S. This should be relatively short,
at most 2 pages. You don’t have to fully solve the problem, but a clear
mathematical setup and discourse into the techniques + tools used to solve the
problem would be sufficient.

8 QUANT

You might also like