From 32741fd842a658d3abb1eb95e036c6bbfd80d6fe Mon Sep 17 00:00:00 2001
From: Danglewood <85772166+deeleeramone@users.noreply.github.com>
Date: Wed, 12 Oct 2022 00:40:22 -0700
Subject: [PATCH] Introduction Guide for the Stocks SDK (#2795)
Adds an introduction guide for the Stocks SDK.
---
website/content/api/stocks/_index.md | 67 ++++++++++++++++++++++++++--
1 file changed, 64 insertions(+), 3 deletions(-)
diff --git a/website/content/api/stocks/_index.md b/website/content/api/stocks/_index.md
index c8c2d6a61a4..b08ea41b31b 100644
--- a/website/content/api/stocks/_index.md
+++ b/website/content/api/stocks/_index.md
@@ -1,6 +1,67 @@
---
-title: stocks
-keywords: ""
-excerpt: ""
+title: Introduction to the Stocks SDK
+keywords: "stocks, stock, options, option, call, put, earnings, calendar, how-to, guide, scripts, fundamental, analysis, technical, behavioural, analyst, equity, research, api, sdk, application, python, notebook, jupyter"
+excerpt: "This guide introduces the Stocks menu in the context of the OpenBB SDK."
geekdocCollapseSection: true
---
+
+The Stocks menu wraps all of the functions from the OpenBB Terminal application into a powerful SDK, enabling users to work with the data in a flexible environment that can be fully customized to meet the needs of any user. Code completion and contextual help makes the SDK is easy to use. Navigation is very similar to operating the CLI Terminal Application.
+
+## How to use the Stocks SDK
+
+Start a Jupyter Notebook with as little as one line of code:
+
+`from openbb_terminal.api import openbb`
+
+In the next cell, the code complete will activate after the `.` is entered, showing the submenus and functions at the root level of the Stocks menu.
+
+
+
+The contents of the menu is printed by running a cell with: `openbb.stocks`
+
+
+
+Docstrings for each function are printed using the `help()` function of Python: `help(openbb.stocks.candle)`
+
+
+
+Add `%matplotlib inline` to the first cell for displaying charts in a Notebook file.
+
+A candle chart is shown with: `openbb.stocks.candle(symbol = 'ticker')`. The contextual help shows the syntax and arguments for the function.
+
+
+
+## Examples
+
+Load historical price data into a Pandas DataFrame by declaring a name for the DataFrame:
+
+`spy_monthly = openbb.stocks.load(symbol = 'SPY', start_date = '1990-01-01', monthly = True)`
+
+
+
+Give the candle chart a custom title:
+
+`openbb.stocks.candle(data = spy_monthly, symbol = 'SPY - Monthly Candles')`
+
+
+
+Get the options data for a specific expiration date:
+
+
+
+Search for a company with the `search` function:
+
+`openbb.stocks.search(sector = 'Energy', country = 'United Kingdom', query = 'oil')`
+
+
+
+Screen stocks reporting earnings this week:
+
+`earnings_calendar = openbb.stocks.disc.upcoming(limit = 1)`
+`earnings_tickers = list(earnings_calendar.Ticker)`
+`earnings_screener = openbb.stocks.ca.screener(similar = earnings_tickers, data_type = 'valuation')`
+`pd.DataFrame(earnings_screener).sort_values(by = 'P/B')`
+
+
+
+Have you created a script using the OpenBB SDK? Show us your examples on social media!