Skip to content

Commit

Permalink
fix(yahoo): handle change in current price schema from yahoo finance
Browse files Browse the repository at this point in the history
  • Loading branch information
rodionlim committed Dec 2, 2021
1 parent 7595a8b commit ea7e313
Show file tree
Hide file tree
Showing 17 changed files with 664 additions and 667 deletions.
68 changes: 34 additions & 34 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Prerequisites**
- [ ] I am running the latest version (Else, state the version / branch in the description)
- [ ] I checked to make sure that this issue has not already been filed

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- Operating System: [e.g. windows / mac]

**Additional context**
Add any other context about the problem here.
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Prerequisites**
- [ ] I am running the latest version (Else, state the version / branch in the description)
- [ ] I checked to make sure that this issue has not already been filed

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- Operating System: [e.g. windows / mac]

**Additional context**
Add any other context about the problem here.
40 changes: 20 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
30 changes: 15 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
StockScraper/.vs

# Files that can be rebuilt via compilation should be excluded
StockScraper/StockScraper/bin/Debug/*
StockScraper/StockScraper/bin/Release
StockScraper/StockScraper/obj

# Packages should be installed via Nuget
StockScraper/packages

# Files that are specific to the developer's setup
StockScraper/StockScraper/StockScraper.csproj.user

# Leave these files for users that do not want to compile the project themselves
!StockScraper/StockScraper/bin/Debug/StockScraper-AddIn-packed.xll
StockScraper/.vs

# Files that can be rebuilt via compilation should be excluded
StockScraper/StockScraper/bin/Debug/*
StockScraper/StockScraper/bin/Release
StockScraper/StockScraper/obj

# Packages should be installed via Nuget
StockScraper/packages

# Files that are specific to the developer's setup
StockScraper/StockScraper/StockScraper.csproj.user

# Leave these files for users that do not want to compile the project themselves
!StockScraper/StockScraper/bin/Debug/StockScraper-AddIn-packed.xll
!StockScraper/StockScraper/bin/Debug/StockScraper-AddIn64-packed.xll
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2020 Rodion

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright (c) 2020 Rodion
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
196 changes: 98 additions & 98 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,98 +1,98 @@
# Excel Stock/Crypto Price Extraction

This repository provides an excel addin with user defined functions to scrape stock market data from Yahoo and Google Finance, and Crypto data from FTX.

We only support current price `CURRENT PRICE` for Google Finance and FTX data source while the full list of fields supported for Yahoo Finance can be found below.

This addin is only tested to be working on Windows platform.

![](excel-stock-webscrape-demo.gif)

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites

What things you need to build the software (Not required if taking the dll files directly) and how to install them

- Visual Studio 2019

### Installing

A step by step series of examples that tell you how to get a development env running

```
Download latest release (Depending on whether Excel is 32 or 64bit, choose StockScaper-AddIn*-packed.xll file)
Open Excel > File > Options > Add-ins > Manage Excel Add-ins > Browse >
Pre-built binaries can also be found in StockScraper/StockScraper/bin/Debug/
```

To build the project from source:

```
Build the project with the .sln file
```

Link the generated xll file

```
Follow the first step
```

### Usage

Fields in brackets are optional and does not need to be specified.
To get the latest market data for an exchange traded ticker:

```
Syntax: =bdp( {ticker}, [{yahoo field}], [{data source}] )
Yahoo Finance Data Source
=bdp("ES3.SI") - STI ETF's current price
=bdp("AAPL", "foward dividend & yield") - Apple's dividend yield
=bdp("AAPL", "current price") - Apple's current price
=bdp("MSFT", "volume") - Microsoft's volume traded
Google Finance Data Source
=bdp("goog",,"google") - Google's current price
=bdp("aapl",,"google") - Apple's current price
FTX Data Source
=bdp("btc/usd",,"ftx") - BTC/USD's current price
=bdp("btc-0924",,"ftx") - BTC/USD's September futures price
```

List of available fields

```
PREVIOUS CLOSE,
CURRENT PRICE,
OPEN,
BID,
ASK,
DAY'S RANGE,
52-WEEK RANGE,
VOLUME,
AVG. VOLUME,
NET ASSETS,
NAV,
PE RATIO (TTM),
YIELD,
YTD DAILY TOTAL RETURN,
BETA (5Y MONTHLY),
EXPENSE RATIO (NET),
INCEPTION DATE
MARKET CAP,
EPS (TTM),
EARNINGS DATE,
FORWARD DIVIDEND & YIELD,
EX-DIVIDEND DATE,
1Y TARGET EST
```

Available fields for yahoo data source differs based on the type of ticker, for example, `yield` is only available for etfs while `forward dividend & yield` is only available for single tock.

To check if a field is available for a particular ticker, please check the summary table from yahoo finance directly.

<img src="summary_table.PNG" width="400" height="300"/>
# Excel Stock/Crypto Price Extraction

This repository provides an excel addin with user defined functions to scrape stock market data from Yahoo and Google Finance, and Crypto data from FTX.

We only support current price `CURRENT PRICE` for Google Finance and FTX data source while the full list of fields supported for Yahoo Finance can be found below.

This addin is only tested to be working on Windows platform.

![](excel-stock-webscrape-demo.gif)

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites

What things you need to build the software (Not required if taking the dll files directly) and how to install them

- Visual Studio 2019

### Installing

A step by step series of examples that tell you how to get a development env running

```
Download latest release (Depending on whether Excel is 32 or 64bit, choose StockScaper-AddIn*-packed.xll file)
Open Excel > File > Options > Add-ins > Manage Excel Add-ins > Browse >
Pre-built binaries can also be found in StockScraper/StockScraper/bin/Debug/
```

To build the project from source:

```
Build the project with the .sln file
```

Link the generated xll file

```
Follow the first step
```

### Usage

Fields in brackets are optional and does not need to be specified.
To get the latest market data for an exchange traded ticker:

```
Syntax: =bdp( {ticker}, [{yahoo field}], [{data source}] )
Yahoo Finance Data Source
=bdp("ES3.SI") - STI ETF's current price
=bdp("AAPL", "foward dividend & yield") - Apple's dividend yield
=bdp("AAPL", "current price") - Apple's current price
=bdp("MSFT", "volume") - Microsoft's volume traded
Google Finance Data Source
=bdp("goog",,"google") - Google's current price
=bdp("aapl",,"google") - Apple's current price
FTX Data Source
=bdp("btc/usd",,"ftx") - BTC/USD's current price
=bdp("btc-0924",,"ftx") - BTC/USD's September futures price
```

List of available fields

```
PREVIOUS CLOSE,
CURRENT PRICE,
OPEN,
BID,
ASK,
DAY'S RANGE,
52-WEEK RANGE,
VOLUME,
AVG. VOLUME,
NET ASSETS,
NAV,
PE RATIO (TTM),
YIELD,
YTD DAILY TOTAL RETURN,
BETA (5Y MONTHLY),
EXPENSE RATIO (NET),
INCEPTION DATE
MARKET CAP,
EPS (TTM),
EARNINGS DATE,
FORWARD DIVIDEND & YIELD,
EX-DIVIDEND DATE,
1Y TARGET EST
```

Available fields for yahoo data source differs based on the type of ticker, for example, `yield` is only available for etfs while `forward dividend & yield` is only available for single tock.

To check if a field is available for a particular ticker, please check the summary table from yahoo finance directly.

<img src="summary_table.PNG" width="400" height="300"/>
Loading

0 comments on commit ea7e313

Please sign in to comment.