Comments (2)
Thanks! Will check when we update data and code early this year.
from crosssection.
I took a look, finally. It turns out we don't need to worry about negative close values because the query filters for volume > 0. I took a quick look at the output and didn't find any negative close values in 1999. The query is below
## download daily data with lots of filters
res <- dbSendQuery(
wrds
,paste0("
select a.secid, a.date, a.close
,b.optionid, b.cp_flag, b.strike_price, b.impl_volatility "
,"from optionm.secprd"
,year
," as a left join optionm.opprcd"
,year
," as b
on a.secid = b.secid and a.date = b.date
where (b.strike_price != 'NaN') and (b.impl_volatility != 'NaN')
and (b.exdate - a.date >= 10) and (b.exdate - a.date <= 60)
and (
(b.cp_flag = 'C' and b.strike_price/1000/a.close > 0.95 and b.strike_price/1000/a.close < 1.05)
or
(b.cp_flag = 'P' and b.strike_price/1000/a.close < 0.95 and b.strike_price/1000/a.close > 0.80)
)
and a.volume > 0
and b.impl_volatility > 0.03 and b.impl_volatility < 2.0
and (b.best_bid+b.best_offer)/2 > 0.125
and b.open_interest > 0 and b.volume != 'NaN'
and extract(day from a.date) >= 23
")
)
tempd <- dbFetch(res, numRowsToPull)
Using year = 1999, I get the following:
from crosssection.
Related Issues (20)
- SignalDoc improvement HOT 3
- Suggestion to substitute Hvidkjaer data for Duarte et al data in ZB_PIN.do HOT 1
- ChNAnalyst has gaps HOT 1
- iomom_supp has gaps HOT 3
- DivYieldST has gaps HOT 1
- MRreversal.do and Mom18m13m.do HOT 3
- ZI_PatentCitations.do RC 601 HOT 1
- Reorg OptionMetricsProcessing.R around datasets HOT 1
- Adding 3 predictors from An, Ang, Bali, Cakici 2014 HOT 1
- Recognizing Dennis Stattman (1980) for B/M HOT 10
- zerotrade
- Relocating shrcd and exchcd filters from SignalMasterTable.do to SignalDoc.csv HOT 1
- signaldoc.csv DivYieldST sweight is NA
- mom6mjunk data ends in 2017 HOT 2
- FirmAgeMom missing values and weird code HOT 1
- betaVIX data ends in 2021 HOT 2
- dCPVolSpread has the wrong sign in SignalDoc.csv
- Improved economic categories for predictors
- Adjustment of Book Value of Equity when we make FailureProbability HOT 1
- Typo for AgeIPO in SignalDoc
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crosssection.