ExperimentalFinanceLecture-4L

ExperimentalFinanceLecture-4L - Experimental Finance IEOR...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Experimental Finance, IEOR Mike Lipkin, Pankaj Mody Experimental Finance Mike Lipkin, Alexander Stanton Page 2 Housekeeping • Make sure your tables/views/functions are prefixed with UNI ID • One zip file please, containing other files • This week ` s winner is: • One PDF with an excel file, zipped, 49kb • This week ` s virtual space waster: • a 20MB email • 9 excel attachments and no UNI ID • Experimental Finance Mike Lipkin, Alexander Stanton Page 2 Housekeeping • Make sure your tables/views/functions are prefixed with UNI ID • One zip file please, containing other files • This week ` s winner is: • One PDF with an excel file, zipped, 49kb • This week ` s virtual space waster: • a 20MB email • 9 excel attachments and no UNI ID • Project groups: Everyone settled? Experimental Finance Mike Lipkin, Alexander Stanton Page 3 Outline • Some SQL queries you can help me with • Creating tables and temporary tables • Creating Indices Another Query Tool Experimental Finance Mike Lipkin, Alexander Stanton Page 4 DB Visualizer (free version) – www.dbvis.com Experimental Finance Mike Lipkin, Alexander Stanton Page 5 Integers SELECT strike/1000 from option_price_view SELECT strike/1000.0 SELECT 0.001*strike SELECT CAST(strike/1000 as float) SELECT CAST(15/1000 as float) DECLARE @result AS FLOAT SET @result = 100/65 What are correct values for strikes? 2.5, 2, 5, 59, 57? SELECT CAST(strike as float)/1000 Experimental Finance Mike Lipkin, Alexander Stanton Page 6 Strike calculation SELECT strike/1000 FROM option_price_view Correct: SELECT CAST(strike AS FLOAT)/1000 FROM option_price_view SELECT strike/1000.0 FROM option_price_view (correct but prone to error) Strike 5 7 10 12 15 Experimental Finance Mike Lipkin, Alexander Stanton Page 7 PS1 Questions ATM: what is an l At The Money z option on Jan 10 th , 2005? How many prices are in IVY…? SELECT count(Distinct bestBid) + count(Distinct bestAsk) FROM …. SELECT date, strike, CallPut, Delta FROM option_price_2005_01 op WHERE securityID=107525 AND delta LIKE '%0.50%' If it is a slightly ambiguous question… either Ask or specify your Thought Process ! Experimental Finance Mike Lipkin, Alexander Stanton Page 8 l At The Money z 1) strike with closest dollar distance to the stock's close price 2) strike with the minimum straddle delta per series 3) strike with the maximum straddle premium over parity per series Experimental Finance Mike Lipkin, Alexander Stanton Page 9 Count trades by week SELECT DATEPART(week,date), COUNT(DISTINCT bestbid) FROM option_price_2000_02 GROUP BY DATEPART(week,date) Experimental Finance Mike Lipkin, Alexander Stanton Page 10 Count trades by week SELECT DATEPART(week,date), COUNT(DISTINCT bestbid) FROM option_price_2000_02 GROUP BY DATEPART(week,date) • counting only distinct best bids – probably not useful • use a column or even better count(*) for shorthand SELECT DATEPART(week,date), COUNT(*) FROM option_price_2000_02 GROUP BY DATEPART(week,date) Week Count 1 789559 2 807923 3 648379 4 764197 5 154256 Experimental Finance...
View Full Document

Page1 / 54

ExperimentalFinanceLecture-4L - Experimental Finance IEOR...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online