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?
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.0What 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.