Skip to content
Alphanume Learn

Guided Python project

IPO Lockup Expiration Backtest in Python

When a large block of shares becomes eligible for sale, does the stock tend to fall?

Open the workbench

Choose Teaching sample to run Python without signing in.

How to run the test

Match the first sellable session to stock prices. Keep releases that meet your size cutoff and were known before entry. For this rule, enter short at that session’s open and cover at the close of session ten, counting the entry session as day one.

Worked example · fictional data

In fictional event EX01, the release is twice the offering float and clears a cutoff of one times that float. The entry price is $10.00 and the tenth session closes at $9.40.

entry, exit_price = 10.00, 9.40
short_return_pct = 100 * (entry - exit_price) / entry
print(round(short_return_pct, 2))  # 6.0

What the result tells you

The stock fell 6%, so the example short earns a gross 6% of the initial share value. Try a five-session exit next and compare the sample size and losing events as well as the average.

An eligible release does not tell you whether anyone sold. The worked return excludes borrow, dividends, commissions and slippage. The historical exercise reconstructs filing terms; it is not a record of alerts available at the time.

Projects Test a stock-event strategy
0 of 5 steps complete

Step 1 of 5 · Define the setup

Turn the release into a trading rule.

A lockup limits when existing shareholders can sell. When it expires, those shares become eligible for sale. That gives you an event with a date and a size.

Test a simple idea: larger releases may be followed by weaker stock returns. Select a minimum release size, enter at the first sellable session’s open, and exit after a fixed number of trading sessions.

Your task

Read the default short rule, ten-session hold and release-size filter. Run the Python before changing them.

One thing to remember

This is a hypothesis to test. Shares becoming eligible for sale does not prove that holders sold them.

Connecting the dataset and preparing the study…

Loading draft…
Alphanume data

Loading the project’s real dataset.

Loading your code…

Progress for this project is separate from your full course.