Adds Introduction to the Stocks Insider Trading Menu (#1931)

* Adds Introduction to the Stocks Insider Trading Menu

Adds intro guide for Insider submenu.

* adds demo routine for the insider trading menu

adds demo routine for the insider trading menu

* adds demo routine for the Government Menu

adds demo routine for the Government Menu

* Adds Introduction to the Government Menu

adds guide for the Government menu.

* Linter

* Removed sentence

Co-authored-by: James Maslek <jmaslek11@gmail.com>
This commit is contained in:
Danglewood
2022-06-17 10:39:15 -07:00
committed by GitHub
parent 99dce2457a
commit 7486e7ff86
4 changed files with 231 additions and 8 deletions

43
routines/gov_demo.openbb vendored Normal file
View File

@@ -0,0 +1,43 @@
# This script requires you to use arguments. This can be done with the following:
# exe routines/example_with_inputs.openbb -i TSLA,AAPL,MSFT
# Go to the Government submenu
stocks
gov
# Last Senate, Congress & House trades
lasttrades congress
lasttrades senate
lasttrades house
# Lobbying efforts
toplobbying
toplobbying -l 50 --raw
# Government spending
lastcontracts -p 1 -l 100 -s
# Load Microsoft for analysis
load msft
# Show government officials trades over six months
gtrades congress
gtrades congress --raw
gtrades senate
gtrades senate --raw
gtrades house
gtrades house --raw
# Show MSFT lobbying efforts on sigle-issue agendas
lobbying -l 20
# Historical Quarterly Government Contracts Awarded to MSFT
histcont
# Top tickers for overall trading by elected officials
topbuys congress
topbuys senate
topbuys house
topsells congress
topsells senate
topsells house

34
routines/insider_demo.openbb vendored Normal file
View File

@@ -0,0 +1,34 @@
# This script does not require you to use arguments.
# Go to the Insider Trading menu.
stocks
ins
# Commands not dependent on a loaded ticker
lcb
lit
lis
blcs
tispm
tippm
lip
lpsb
# Screener functions
set Gold-Silver
filter
set Retail-Trade
filter
set Guided-Missiles
filter
set Credit-Industry
filter
set Pharmaceuticals
filter
# Functions requiring a ticker
load spgi -s 2022-01-01
act
stats
lins

View File

@@ -1,10 +1,90 @@
---
title: Introduction to the Government Menu
keywords: "Government, house, senate, politician, lobby, lobbyist, contract, contractor, spending, budget, treasury, trading, buys, sells, ticker, tickers, companies, listing, exchange"
date: "2022-06-02"
type: guides
status: publish
excerpt: "This guide introduces the Government submenu, within the Stocks menu, by briefly explaining the features and how to use them, showing examples in context."
geekdocCollapseSection: true
---
A government is the system or collection of individuals in charge of governing a formally constituted community, such as a state. In its broadest sense, government is made up of three parts: legislature, executive branch, and judiciary. Government is both a tool of enforcing organizational policies and a system for defining policy. Many governments have a constitution, which is a statement of the government's guiding ideas and ideology.
The features in this menu are intended to show the reported trades of elected officials, lobbyist activity, awarded contracts, and general spending of the United States Treasury Department. This menu only covers the USA, or companies that trade on US exchanges. The information in this menu is compiled by <a href="https://quiverquant.com" target="_blank">QuiverQuant</a>.
Within this menu, the actions regarding lobbying, governmental contracts as well as governmental transactions are depicted.
A ticker is not required to enter the menu; navigate there from anywhere in the terminal with absolute path jumping: `/stocks/gov`
**Available commands:**
{{< toc-tree >}}
![The Government Menu](https://user-images.githubusercontent.com/85772166/173205843-1d9d5679-df73-4ec3-8b98-937f38ccac35.png)
<h2>How to use the Government Menu</h2>
The menu is divided into two sections. Features under the `Explore:` do not depend on individual tickers, while the commands listed under `Ticker:` do. Entering `lasttrades` will return a table with the five most recent days of reported trades made by Congress members.
![Last trades from Congress](https://user-images.githubusercontent.com/85772166/173205858-c2b8ccc7-8bf3-4443-bfe1-9364b5397e16.png)
`lasttrades senate` & `lasttrades house` will other elected officials.
![Last trades posted from the Senate and the House](https://user-images.githubusercontent.com/85772166/173205867-93390576-e6f0-443b-aa0a-e5703fedb0e3.png)
`toplobbying` brings up a bar graph of recent big spenders on K Street, that are listed on-exchange. The optional arguments `l`, `--raw` & `--export` changes the number of companies returned, shows a table of the raw data, or exports the data to a file.
![Top ten companies actively lobbying the US government](https://user-images.githubusercontent.com/85772166/173206158-bd42523c-50de-4f44-b1b5-7012cadc44a2.png)
The trivial spending by government can be tracked with the command, `lastcontracts`. Screwdrivers, furniture, bath towels; keep tabs on where those tax dollars are spent.
![The latest agency line items to be reported](https://user-images.githubusercontent.com/85772166/173206164-a76b89f1-23fb-4ef1-ae0d-b1e7989f12ea.png)
`load` a specific ticker to activate the lower features.
<h2>Examples</h2>
Microsoft is a favourite in Washington; `gtrades` shows the bullish or bearish tendencies of elected officials over time.
![Microsoft trades by elected officials](https://user-images.githubusercontent.com/85772166/173206175-e6b0436a-82cd-4075-b4bf-87926db0a31e.png)
A table of this chart, with representatives' names, is called by adding the `--raw` flag to the command string.
![Respresentatives and their recent MSFT transactions](https://user-images.githubusercontent.com/85772166/173206186-bb8e3200-b596-49d7-b4b8-5037e62f071a.png)
A breakdown of single-issue items the company is lobbying for will be printed by the command, `lobbying`:
````
(🦋) /stocks/gov/ $ lobbying
2022-05-31: MICROSOFT CORP $30000
Cascadia High Speed Rail Funding opportunities. High-skilled immigration reform Energy efficiency; climate change issues and sustainability Cyber Security, including protecting elections Competition policy; supply chain issues. Workforce development issues; skilling; H.R. 1735, To provide a temporary safe harbor for publishers of online content to collectively negotiate with dominant online platforms regarding the terms on which content may be distributed. Broadband connectivity; artificial intelligence. Computer science education Privacy--intelligence and surveillance.
2022-05-26: MICROSOFT CORPORATION $50000
Tax reform ECPA, CS for Al, STEM, TV White Spaces, Ariband, Rural Broadband Warrants, Surveillance EPCA, Cyber Security Cyber Security, Bulk Data collection, Surveillance, ECPA, Lawful Access High Skilled immigration, Immigration reform, DACA
2022-05-13: MICROSOFT $15000
Issues related to potential VISA reform. The role of technology in defense. Innovations ability to strengthen national security. Broadband connectivity and access. Defense technology issues.
2022-05-02: CORNERSTONE GOVERNMENT AFFAIRS OBO MICROSOFT CORPORATION $0
2022-04-20: MICROSOFT CORPORATION $70000
S.1260, United States Innovation and Competition Act of 2021, Workforce training issues H.R.4521, America COMPETES Act of 2022, Workforce training issues Workforce Innovation and Opportunity Act, Workforce training issues Cyber Security Work Force S.1260, United States Innovation and Competition Act of 2021, Computer Science Education H.R.4521, America COMPETES Act of 2022, Computer Science Education Workforce issues, generally Computer Science Education
2022-04-20: MICROSOFT CORPORATION $0
2022-04-20: MICROSOFT CORPORATION $0
2022-04-20: MICROSOFT CORPORATION $50000
Privacy; broadband infrastructure adoption and deployment; trade; sustainability education; H.R. John Lewis Voting Rights Advancement Act; Cybersecurity; NDAA; criminal justice reform.
2022-04-20: MICROSOFT CORPORATION $30000
Monitor possible legislation to provide state tax relief for employees stranded outside their home state by COVID. Monitor postal reform. Monitor issues relating to trade agreements. Monitor cybersecurity legislation. Monitor privacy oversight issues. Monitor issues relating to use of TV white space spectrum. Monitor H1-B Visas. Monitor issues relating to high-skilled immigration. Monitor software piracy, counterfeiting, and protection of intellectual property rights. Monitor patent reform. Competitiveness in the online advertising and software markets. Competitiveness and the high tech sector. Monitor issues related to government access to customer data. Monitor Cloud computing issues. Monitor STEM education legislation. Monitor issues relating to data breach legislation and data breaches. Monitor issues relating to artificial intelligence. Monitor issues relating to facial recognition technology. Monitor issues relating election security technology. Monitor issues relating to Section 230 of the Communications Decency Act.
2022-04-20: MICROSOFT CORPORATION $0
````
The consistency of quarterly contract awards over time is reflected in a chart requested by the command, `histcont`
![History of Quarterly Contracts Awarded to MSFT](https://user-images.githubusercontent.com/85772166/173206200-347aef6e-6b27-4bf8-9422-c03c5b414361.png)
The ten most purchased and sold stocks amongst Senate Representatives, `topsells senate` & `topbuys senate`:
![Senate's Most Bought and Sold Stocks](https://user-images.githubusercontent.com/85772166/173206214-964bfe40-a72c-4833-8cc1-a803bba97c6e.png)
To play a demonstration in the OpenBB Terminal of the features presented in this guide, execute the routine file, `gov_demo.openbb`, from the Home Menu.
![Playing the demonstration file to this guide](https://user-images.githubusercontent.com/85772166/173206226-2519d9ae-07b7-4cc7-b8a6-17c514c0d1df.png)
Back to the <a href="https://openbb-finance.github.io/OpenBBTerminal/terminal/stocks/" target="_blank">Introduction to Stocks Guide</a>.

View File

@@ -1,10 +1,76 @@
---
title: Introduction to the Insider Trading Menu
keywords: "Executive, director, directors, CEO, CFO, CIO, COO, DIR, sell, buy, SEC, disclosure, disclose, stats, act, lins, filter, view, set, lcb, lpsb, lit, lip, blip, blop, bclp, lis, blis, blos, blcs, topt, toppw, toppm, tipt, tippw, tippm, tist, tispw, tispm, openinsider, finviz, business, stocks, options"
date: "2022-06-10"
type: guides
status: publish
excerpt: "This guide introduces the Insider Trading submenu, within the Stocks menu, by briefly explaining the features and how to use them, showing examples in context."
geekdocCollapseSection: true
---
Insider trading is when someone with non-public, substantial information about a public company's shares trades in that stock for whatever purpose. Depending on when the insider makes the trade, insider trading can be either unlawful or legal.
The Insider Trading Menu has two general purposes:
- A stock screener for SEC Form 4 filings.
- Researching individual companies for executive and director transactions.
When material knowledge is still classified as confidential, insider trading is prohibited, and this type of insider trading carries severe penalties.
Navaigate to the Insider Trading submenu from the `stocks` menu by typing `ins` and pressing `enter`. The features in this menu function only for companies registered with the SEC, that also trade in public markets.
**Available commands:**
{{< toc-tree >}}
<img width="1174" alt="Insider Trading Menu" src="https://user-images.githubusercontent.com/85772166/173204667-6be5813f-ce80-4c11-b63b-35363d8caa44.png">
<h2>How to use the Insider Trading Menu</h2>
The menu is contains three groups of functions for:
- Setting, viewing presets for the filter, and screening.
- Using with individual stocks.
- Filtering all submitted SEC Form 4 records by defined metrics.
The last of these groups encompasses the majority of commands in the Insider Trading submenu. They are for scanning the entire market based on the description listed next to the command.
`lcb` - Latest cluster buys:
<img width="1177" alt="Latest Cluster Buys" src="https://user-images.githubusercontent.com/85772166/173204685-7c91e43d-5432-4532-ab07-8ce095cc3a0a.png">
With the `--export` argument attached, data from this menu can be exported as CSV, JSON, or XLSX files.
`lit` - Latest insider trades from all filings:
<img width="1177" alt="Latest Insider Trades" src="https://user-images.githubusercontent.com/85772166/173204706-08fa491d-4140-4d39-a787-325524fb5bd0.png">
`tispm` - Top insider sales from the last month:
<img width="1175" alt="Top insider sales from the last month" src="https://user-images.githubusercontent.com/85772166/173204715-626fd866-33e7-499c-9f24-c1b71e5b84fa.png">
`view` will list the available presets to use as a screener. The screener uses `.ini` files which can be modified by the user to create custom presets. Find them in the local installation folder, under: `~/OpenBB/openbb_terminal/stocks/insider/presets/`. The default preset is `whales`, which targets trades over $500K in the last two weeks. Other included presets are for scanning individual industries as a group.
The `set` command is used to select a preset. Autocomplete will assist the user and the arrow keys can be used to make a choice. Use the file `template.ini` to build a custom preset. Changes made to an existing `.ini` file will be effective the next time the `filter` command is run.
<img width="1139" alt="Set Command" src="https://user-images.githubusercontent.com/85772166/173204733-7189ea05-68e5-465d-bef9-b74861842894.png">
`filter` will screen based on the selected preset.
<img width="1175" alt="Filter Command" src="https://user-images.githubusercontent.com/85772166/173204750-e811e346-091f-4d92-93bf-f942528eef6c.png">
With a ticker loaded the `stats`, `act`, and `lins` commands are available.
<img width="1173" alt="Stats Command with RKT loaded" src="https://user-images.githubusercontent.com/85772166/173204762-1fc19a6a-99d1-44af-8034-ead70d2858c7.png">
<h2>Examples</h2>
Using the Retail-Trade preset:
<img width="1172" alt="Retail Trade Screener" src="https://user-images.githubusercontent.com/85772166/173204772-5cc8770e-801f-4a02-8b12-94c4bed948da.png">
Using the Guided-Missiles preset:
<img width="1175" alt="Guided Missiles Screener" src="https://user-images.githubusercontent.com/85772166/173204809-c89c346c-f1a9-4202-919e-16a2641abe73.png">
`act` shows recent trading activity plotted with the price:
![Insider trading activity and Price of TSLA](https://user-images.githubusercontent.com/85772166/173204788-8684f30e-3625-423d-a61d-90b5edcd62df.png)
The latest purchases from insiders of penny stock companies:
<img width="1173" alt="Last Penny Stock Insider Purchases" src="https://user-images.githubusercontent.com/85772166/173204831-a859ce15-13aa-4f1c-afa9-88a3086ef37a.png">
Run `exe insider_demo.openbb`, from the Main Menu, to play a demonstration of the features in the OpenBB Terminal.
Back to: <a href="https://openbb-finance.github.io/OpenBBTerminal/terminal/stocks/">Introduction to Stocks</a>