summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormontezdesousa <79287829+montezdesousa@users.noreply.github.com>2024-02-05 17:01:15 +0000
committerGitHub <noreply@github.com>2024-02-05 17:01:15 +0000
commita75d32610b62999d7ea4a29aecf4ce05571dc1db (patch)
tree61c25ff269f28e05bbd37965b7c70a29c0d93550
parent074cffaaad6492212f9f96d247b4ff88410ede2f (diff)
Docs/byod (#5996)
* add byod to reference * fix: rename add-in name * feat: add data conectors page * fix: additional notes * tiny tweaks * update functions.json and openapi.json * fix: fix bug in hedge controller * fix: another bug hedgecontroller * black --------- Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
-rw-r--r--openbb_terminal/stocks/options/hedge/hedge_controller.py46
-rw-r--r--website/content/excel/data-conectors.md36
-rw-r--r--website/content/excel/functions.json98
-rw-r--r--website/content/excel/getting-started/basics.md2
-rw-r--r--website/content/excel/getting-started/installation.md4
-rw-r--r--website/content/excel/openapi.json4715
-rw-r--r--website/content/excel/templates.mdx4
-rw-r--r--website/content/pro/main-menu/data-connectors/integrate-your-own-backend.md1
-rw-r--r--website/generate_excel_markdown.py97
-rw-r--r--website/src/pages/index.tsx4
10 files changed, 4447 insertions, 560 deletions
diff --git a/openbb_terminal/stocks/options/hedge/hedge_controller.py b/openbb_terminal/stocks/options/hedge/hedge_controller.py
index 8969d88d845..7eb716b9024 100644
--- a/openbb_terminal/stocks/options/hedge/hedge_controller.py
+++ b/openbb_terminal/stocks/options/hedge/hedge_controller.py
@@ -49,26 +49,40 @@ class HedgeController(BaseController):
self.underlying_asset_position: str = ""
self.chain = get_option_chain(ticker, expiration)
- self.calls = list(
- zip(
- self.chain.calls["strike"].tolist(),
- self.chain.calls["impliedVolatility"].tolist(),
- self.chain.calls["lastPrice"].tolist(),
- self.chain.calls["currency"].tolist(),
+ self.calls = (
+ list(
+ zip(
+ self.chain.calls["strike"].tolist(),
+ self.chain.calls["impliedVolatility"].tolist(),
+ self.chain.calls["lastPrice"].tolist(),
+ self.chain.calls["currency"].tolist(),
+ )
)
+ if "calls" in self.chain.columns
+ else []
)
- self.puts = list(
- zip(
- self.chain.puts["strike"].tolist(),
- self.chain.puts["impliedVolatility"].tolist(),
- self.chain.puts["lastPrice"].tolist(),
- self.chain.calls["currency"].tolist(),
+ self.puts = (
+ list(
+ zip(
+ self.chain.puts["strike"].tolist(),
+ self.chain.puts["impliedVolatility"].tolist(),
+ self.chain.puts["lastPrice"].tolist(),
+ self.chain.calls["currency"].tolist(),
+ )
)
+ if "puts" in self.chain.columns
+ else []
)
+ start = self.calls[0] if self.calls else 0
+ end = self.calls[-1] if self.calls else 0
+
+ start = int(start[0]) if isinstance(start, list) and start else 0
+ end = int(end[0]) if isinstance(end, list) and end else 0
+
self.PICK_CHOICES = [
f"{strike} {position} {side}"
- for strike in range(int(self.calls[0][0]), int(self.calls[-1][0]), 5)
+ for strike in range(start, end, 5)
for position in ["Long", "Short"]
for side in ["Call", "Put"]
]
@@ -76,7 +90,11 @@ class HedgeController(BaseController):
self.ticker = ticker
self.current_price: float = get_price(ticker)
self.expiration = expiration
- self.implied_volatility = self.chain.calls["impliedVolatility"]
+ self.implied_volatility = (
+ self.chain.calls.get("impliedVolatility", 0.0)
+ if "calls" in self.chain.columns
+ else 0.0
+ )
self.options: Dict = {"Portfolio": {}, "Option A": {}, "Option B": {}}
self.underlying = 0.0
self.side: str = ""
diff --git a/website/content/excel/data-conectors.md b/website/content/excel/data-conectors.md
new file mode 100644
index 00000000000..14df7fe3ab8
--- /dev/null
+++ b/website/content/excel/data-conectors.md
@@ -0,0 +1,36 @@
+---
+title: Data connectors
+sidebar_position: 4
+description: Access your data connectors from OpenBB Terminal Pro inside OpenBB Add-in for Excel.
+keywords:
+- Microsoft Excel
+- Add-in
+- Advanced
+- Data connectors
+- BYOD
+- Bring your own data
+---
+
+<!-- markdownlint-disable MD033 -->
+import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
+
+<HeadTitle title="Data connectors | OpenBB Add-in for Excel Docs" />
+
+OpenBB Add-In for Excel allows you to access your [data connectors](https://docs.openbb.co/pro/main-menu/data-connectors) from OpenBB Terminal Pro inside Microsoft Excel.
+
+To access data from a [single widget](https://docs.openbb.co/pro/main-menu/data-connectors/single-widget) use:
+
+```excel
+=OBB.BYOD("widget_name")
+```
+
+To access data from your own [backend](https://docs.openbb.co/pro/main-menu/data-connectors/integrate-your-own-backend) use:
+
+```excel
+=OBB.BYOD("widget_name", "backend_name")
+```
+
+#### Additional notes
+
+- Make sure your backend's CORS settings allow requests coming from <https://excel.openbb.co>.
+- Requests via HTTP will be blocked by Excel. So if you are using the Add-in for Excel on Mac or Office on the web with Safari browser you need to run your backend via HTTPS.
diff --git a/website/content/excel/functions.json b/website/content/excel/functions.json
index 54a2329f3b1..1ee4434785c 100644
--- a/website/content/excel/functions.json
+++ b/website/content/excel/functions.json
@@ -1,6 +1,28 @@
{
"functions": [
{
+ "description": "Bring Your Own Data features from OpenBB Terminal Pro.",
+ "helpUrl": "https://docs.openbb.co/excel/data-conectors",
+ "id": "BYOD",
+ "name": "BYOD",
+ "parameters": [
+ {
+ "description": "Name of the widget to get data for.",
+ "name": "widget",
+ "type": "string"
+ },
+ {
+ "description": "Name of the backend to use, required for widgets in custom backends.",
+ "name": "backend",
+ "optional": true,
+ "type": "string"
+ }
+ ],
+ "result": {
+ "dimensionality": "matrix"
+ }
+ },
+ {
"description": "Cryptocurrency Historical Price. Cryptocurrency historical price data.",
"helpUrl": "https://docs.openbb.co/excel/reference/crypto/price/historical",
"id": "CRYPTO.PRICE.HISTORICAL",
@@ -1317,6 +1339,18 @@
"type": "string"
},
{
+ "description": "Start date of the data, in YYYY-MM-DD format.",
+ "name": "start_date",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "End date of the data, in YYYY-MM-DD format.",
+ "name": "end_date",
+ "optional": true,
+ "type": "string"
+ },
+ {
"description": "Options: fmp, intrinio, defaults to fmp.",
"name": "provider",
"optional": true,
@@ -1324,7 +1358,7 @@
},
{
"description": "The number of data entries to return. (provider: intrinio)",
- "name": "page_size",
+ "name": "limit",
"optional": true,
"type": "number"
}
@@ -1386,6 +1420,12 @@
"type": "number"
},
{
+ "description": "Sort the data in ascending or descending order. (provider: fmp)",
+ "name": "sort",
+ "optional": true,
+ "type": "string"
+ },
+ {
"description": "Start date of the data, in YYYY-MM-DD format. (provider: intrinio)",
"name": "start_date",
"optional": true,
@@ -1746,6 +1786,18 @@
"type": "string"
},
{
+ "description": "Start date of the data, in YYYY-MM-DD format.",
+ "name": "start_date",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "End date of the data, in YYYY-MM-DD format.",
+ "name": "end_date",
+ "optional": true,
+ "type": "string"
+ },
+ {
"description": "Options: fmp, defaults to fmp.",
"name": "provider",
"optional": true,
@@ -2041,6 +2093,12 @@
"type": "string"
},
{
+ "description": "The number of data entries to return. Default is 252, the number of trading days in a year.",
+ "name": "limit",
+ "optional": true,
+ "type": "number"
+ },
+ {
"description": "Options: tiingo, defaults to tiingo.",
"name": "provider",
"optional": true,
@@ -2227,6 +2285,12 @@
"name": "provider",
"optional": true,
"type": "string"
+ },
+ {
+ "description": "Include current quarter data. (provider: fmp)",
+ "name": "include_current_quarter",
+ "optional": true,
+ "type": "boolean"
}
],
"result": {
@@ -2430,7 +2494,7 @@
"name": "EQUITY.PRICE.QUOTE",
"parameters": [
{
- "description": "Symbol to get data for. In this case, the comma separated list of symbols.",
+ "description": "Symbol to get data for. This endpoint will accept multiple symbols separated by commas.",
"name": "symbol",
"type": "string"
},
@@ -3723,7 +3787,7 @@
"type": "number"
},
{
- "description": "Options: benzinga, fmp, intrinio, polygon, tiingo, defaults to benzinga.",
+ "description": "Options: benzinga, fmp, intrinio, polygon, tiingo, ultima, defaults to benzinga.",
"name": "provider",
"optional": true,
"type": "string"
@@ -3836,6 +3900,34 @@
}
},
{
+ "description": "Sector News. Get news for one or more sectors.",
+ "helpUrl": "https://docs.openbb.co/excel/reference/news/sector",
+ "id": "NEWS.SECTOR",
+ "name": "NEWS.SECTOR",
+ "parameters": [
+ {
+ "description": "A coma separated list of sectors.",
+ "name": "sectors",
+ "type": "string"
+ },
+ {
+ "description": "The number of data entries to return. Here it is the no. of articles to return.",
+ "name": "limit",
+ "optional": true,
+ "type": "number"
+ },
+ {
+ "description": "Options: ultima, defaults to ultima.",
+ "name": "provider",
+ "optional": true,
+ "type": "string"
+ }
+ ],
+ "result": {
+ "dimensionality": "matrix"
+ }
+ },
+ {
"description": "World News. Global news data.",
"helpUrl": "https://docs.openbb.co/excel/reference/news/world",
"id": "NEWS.WORLD",
diff --git a/website/content/excel/getting-started/basics.md b/website/content/excel/getting-started/basics.md
index 08f8d0ab2d7..c38fd0ed39f 100644
--- a/website/content/excel/getting-started/basics.md
+++ b/website/content/excel/getting-started/basics.md
@@ -14,7 +14,7 @@ import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
<HeadTitle title="Basics | OpenBB Add-in for Excel Docs" />
-The OpenBB Excel Add-in provides direct access to the OpenBB platform, where each function implements the following pattern:
+The OpenBB Add-in for Excel provides direct access to the OpenBB platform, where each function implements the following pattern:
- `OBB.[MENU].[SUB_MENU].[COMMAND]`
diff --git a/website/content/excel/getting-started/installation.md b/website/content/excel/getting-started/installation.md
index 0b3114385bb..5a076585643 100644
--- a/website/content/excel/getting-started/installation.md
+++ b/website/content/excel/getting-started/installation.md
@@ -12,7 +12,7 @@ import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
<HeadTitle title="Installation | OpenBB Add-in for Excel Docs" />
## Requirements
-- The OpenBB Excel Add-in is available on the following platforms: Windows (Microsoft 365), Mac (Microsoft 365), Excel on the web.
+- The OpenBB Add-in for Excel is available on the following platforms: Windows (Microsoft 365), Mac (Microsoft 365), Excel on the web.
- Access to the OpenBB Terminal Pro. If you don't have access you can sign up for the waitlist [here](https://my.openbb.co/app/pro).
## Installation
@@ -27,7 +27,7 @@ import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
/>
</div>
-The OpenBB Excel Add-in is available on the [Microsoft AppSource](https://appsource.microsoft.com/pt-pt/product/office/wa200006381?tab=overview). It can be installed by an administrator or by individual users.
+The OpenBB Add-in for Excel is available on the [Microsoft AppSource](https://appsource.microsoft.com/pt-pt/product/office/wa200006381?tab=overview). It can be installed by an administrator or by individual users.
### Individual user
diff --git a/website/content/excel/openapi.json b/website/content/excel/openapi.json
index 3ca189e42c3..3cdf2a3b929 100644
--- a/website/content/excel/openapi.json
+++ b/website/content/excel/openapi.json
@@ -650,7 +650,7 @@
],
"title": "polygon",
"description": "A specific date to get data for. (provider: polygon)",
- "default": "2024-01-06"
+ "default": "2024-02-02"
},
"description": "A specific date to get data for. (provider: polygon)"
},
@@ -815,6 +815,79 @@
"model": "CurrencyPairs"
}
},
+ "/api/v1/currency/reference_rates": {
+ "get": {
+ "tags": [
+ "currency"
+ ],
+ "summary": "Reference Rates",
+ "description": "Current, official, currency reference rates.",
+ "operationId": "currency_reference_rates",
+ "security": [
+ {
+ "OAuth2PasswordBearer": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "provider",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "const": "ecb",
+ "default": "ecb",
+ "title": "Provider"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OBBject_CurrencyReferenceRates_"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found"
+ },
+ "400": {
+ "description": "No Results Found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenBBErrorResponse"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenBBErrorResponse"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "model": "CurrencyReferenceRates"
+ }
+ },
"/api/v1/derivatives/options/chains": {
"get": {
"tags": [
@@ -865,9 +938,9 @@
}
],
"title": "intrinio",
- "description": "Date for which the options chains are returned. (provider: intrinio)"
+ "description": "The end-of-day date for options chains data. (provider: intrinio)"
},
- "description": "Date for which the options chains are returned. (provider: intrinio)"
+ "description": "The end-of-day date for options chains data. (provider: intrinio)"
}
],
"responses": {
@@ -2107,6 +2180,141 @@
"model": "RiskPremium"
}
},
+ "/api/v1/economy/balance_of_payments": {
+ "get": {
+ "tags": [
+ "economy"
+ ],
+ "summary": "Balance Of Payments",
+ "description": "Balance of Payments Reports.",
+ "operationId": "economy_balance_of_payments",
+ "security": [
+ {
+ "OAuth2PasswordBearer": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "provider",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "const": "ecb",
+ "default": "ecb",
+ "title": "Provider"
+ }
+ },
+ {
+ "name": "report_type",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "enum": [
+ "main",
+ "summary",
+ "services",
+ "investment_income",
+ "direct_investment",
+ "portfolio_investment",
+ "other_investment"
+ ],
+ "type": "string",
+ "title": "ecb",
+ "description": "The report type, the level of detail in the data. (provider: ecb)",
+ "default": "main"
+ },
+ "description": "The report type, the level of detail in the data. (provider: ecb)"
+ },
+ {
+ "name": "frequency",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "enum": [
+ "monthly",
+ "quarterly"
+ ],
+ "type": "string",
+ "title": "ecb",
+ "description": "The frequency of the data. Monthly is valid only for ['main', 'summary']. (provider: ecb)",
+ "default": "monthly"
+ },
+ "description": "The frequency of the data. Monthly is valid only for ['main', 'summary']. (provider: ecb)"
+ },
+ {
+ "name": "country",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "enum": [
+ "brazil",
+ "canada",
+ "china",
+ "eu_ex_euro_area",
+ "eu_institutions",
+ "india",
+ "japan",
+ "russia",
+ "switzerland",
+ "united_kingdom",
+ "united_states",
+ "total",
+ null
+ ],
+ "title": "ecb",
+ "description": "The country/region of the data. This parameter will override the 'report_type' parameter. (provider: ecb)"
+ },
+ "description": "The country/region of the data. This parameter will override the 'report_type' parameter. (provider: ecb)"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OBBject_List_BalanceOfPayments__"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found"
+ },
+ "400": {
+ "description": "No Results Found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenBBErrorResponse"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenBBErrorResponse"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "model": "BalanceOfPayments"
+ }
+ },
"/api/v1/economy/fred_search": {
"get": {
"tags": [
@@ -2175,10 +2383,10 @@
"schema": {
"anyOf": [
{
- "type": "string"
+ "type": "integer"
},
{
- "type": "integer"
+ "type": "string"
},
{
"type": "null"
@@ -3364,10 +3572,13 @@
{
"name": "provider",
"in": "query",
- "required": false,
+ "required": true,
"schema": {
- "const": "fmp",
- "default": "fmp",
+ "enum": [
+ "benzinga",
+ "fmp"
+ ],
+ "type": "string",
"title": "Provider"
}
},
@@ -3383,6 +3594,199 @@
"description": "Symbol to get data for."
},
{
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "integer",
+ "description": "The number of data entries to return.",
+ "default": 100,
+ "title": "Limit"
+ },
+ "description": "The number of data entries to return."
+ },
+ {
+ "name": "fields",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "benzinga",
+ "description": "Comma-separated list of fields to include in the response. See https://docs.benzinga.io/benzinga-apis/calendar/get-ratings to learn about the available fields. (provider: benzinga)"
+ },
+ "description": "Comma-separated list of fields to include in the response. See https://docs.benzinga.io/benzinga-apis/calendar/get-ratings to learn about the available fields. (provider: benzinga)"
+ },
+ {
+ "name": "date",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "benzinga",
+ "description": "Date for calendar data, shorthand for date_from and date_to. (provider: benzinga)",
+ "is_parameters": true
+ },
+ "description": "Date for calendar data, shorthand for date_from and date_to. (provider: benzinga)"
+ },
+ {
+ "name": "date_from",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "benzinga",
+ "description": "Date to query from point in time. (provider: benzinga)",
+ "is_parameters": true
+ },
+ "description": "Date to query from point in time. (provider: benzinga)"
+ },
+ {
+ "name": "date_to",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "benzinga",
+ "description": "Date to query to point in time. (provider: benzinga)",
+ "is_parameters": true
+ },
+ "description": "Date to query to point in time. (provider: benzinga)"
+ },
+ {
+ "name": "importance",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "benzinga",
+ "description": "Importance level to filter by. (provider: benzinga)",
+ "is_parameters": true
+ },
+ "description": "Importance level to filter by. (provider: benzinga)"
+ },
+ {
+ "name": "updated",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "benzinga",
+ "description": "Records last updated Unix timestamp (UTC). (provider: benzinga)",
+ "is_parameters": true
+ },
+ "description": "Records last updated Unix timestamp (UTC). (provider: benzinga)"
+ },
+ {
+ "name": "action",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "enum": [
+ "Downgrades",
+ "Maintains",
+ "Reinstates",
+ "Reiterates",
+ "Upgrades",
+ "Assumes",
+ "Initiates Coverage On",
+ "Terminates Coverage On",
+ "Removes",
+ "Suspends",
+ "Firm Dissolved"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],<