Skip to content

Commit

Permalink
Merge pull request #25 from DidierRLopes/main
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
alokan committed Apr 23, 2021
2 parents 04330f2 + 5be3c6e commit e3fe8db
Show file tree
Hide file tree
Showing 12 changed files with 141 additions and 56 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Expand Up @@ -49,8 +49,9 @@ jobs:
architecture: x64

- name: Install Poetry
uses: snok/install-poetry@v1.1.1
uses: snok/install-poetry@v1.1.4
with:
version: 1.1.6
virtualenvs-create: true
virtualenvs-in-project: true

Expand Down Expand Up @@ -102,8 +103,9 @@ jobs:
architecture: x64

- name: Install Poetry
uses: snok/install-poetry@v1.1.1
uses: snok/install-poetry@v1.1.4
with:
version: 1.1.6
virtualenvs-create: true
virtualenvs-in-project: true

Expand Down
10 changes: 10 additions & 0 deletions ROADMAP.md
Expand Up @@ -20,6 +20,7 @@
* [Credit Analysis](#Credit-Analysis)
* [Cryptocurrencies](#Cryptocurrencies)
* [Screener](#Screener)
* [Forex](#Forex)

## Additional

Expand Down Expand Up @@ -63,6 +64,7 @@

## Fundamental Analysis
* [x] Rearrange FA menu to have AV and FMP as submenus (@didier) - [PR #166](https://github.com/DidierRLopes/GamestonkTerminal/pull/166)
* [x] Add Fundamental Analysis score (@didier) - [PR #383](https://github.com/DidierRLopes/GamestonkTerminal/pull/383)

**NEXT**
* [ ] Add Treasury Yield Curve data (@aia) - [PR #281](https://github.com/DidierRLopes/GamestonkTerminal/pull/281)
Expand Down Expand Up @@ -190,6 +192,7 @@ ___

## Cryptocurrencies
* [x] Add Coingecko (@jmaslek) - [PR #283](#https://github.com/DidierRLopes/GamestonkTerminal/pull/283)
* [x] view top coins from coinmarketcap (@jmaslek) - [PR #378](https://github.com/DidierRLopes/GamestonkTerminal/pull/378)

**NEXT**
* [ ] Add [Coinpaprika](https://coinpaprika.com/api/)
Expand All @@ -209,6 +212,13 @@ ___

---

## Forex
* [x] Add entire forex menu through Oanda (@alokan) - [PR #360](https://github.com/DidierRLopes/GamestonkTerminal/pull/360)

**NEXT**

---

## Backend

**NEXT**
Expand Down
24 changes: 24 additions & 0 deletions gamestonk_terminal/README.md
Expand Up @@ -17,6 +17,7 @@
* [FRED](#FRED-)
* [Options](#Options-)
* [Screener](#Screener-)
* [Forex](#Forex-)

## Main

Expand Down Expand Up @@ -145,6 +146,7 @@ Command|Description
----- | ---------
`screener` |screen info about the company ([Finviz](https://finviz.com/))
`mgmt` |management team of the company ([Business Insider](https://markets.businessinsider.com/))
`score` |investing score from Warren Buffett, Joseph Piotroski and Benjamin Graham ([FMP](https://financialmodelingprep.com/))
[Market Watch API](https://markets.businessinsider.com/) |
`income` |income statement of the company
`balance` |balance sheet of the company
Expand Down Expand Up @@ -272,6 +274,7 @@ Command|Description
------ | ------------
`load`| load cryptocurrency data
`view`| load and view cryptocurrency data
`top` | view top coins from coinmarketcap

 
## Comparison Analysis [»](comparison_analysis/README.md)
Expand Down Expand Up @@ -364,5 +367,26 @@ performance |performance (e.g. Perf Week, Perf YTD, Volatility M)
technical |technical (e.g. Beta, SMA50, 52W Low, RSI, Change)
signals |view filter signals (e.g. -s top_gainers)

 


## Forex [»](forex/README.md)
Command|Description
------ | --------
summary |display a summary of your account
calendar |get information about past or upcoming events which may impact the price
list |list your order history
pending |get information about pending orders
cancel |cancel a pending order by ID
positions |get information about your positions
trades |see a list of open trades
closetrade |close a trade by ID
load |specify an instrument to use
candles |get a candlestick chart for the forex instrument
price |show the current price for the forex instrument
order |place a limit order
orderbook |display the orderbook if Oanda provides one for the forex instrument
positionbook |display the positionbook if Oanda provides one for the forex instrument


 
39 changes: 17 additions & 22 deletions gamestonk_terminal/cryptocurrency/README.md
@@ -1,57 +1,52 @@
# Cryptocurrency
# CRYPTOCURRENCY

This page gives an overview of the ability to load cryptocurrency data.

Current crypto data is [Powered by CoinGecko API](#https://www.coingecko.com/en).
This is an awesome service that currently requires no API Key!

Current functionality is aimed to be similar to loading a stock ticker.
This menu aims to explore crypto world, and the usage of the following commands along with an example will be exploited below.

* [load](#load)
* load a given coin vs a given currency [CoinGecko]
* [view](#view)
* plot the loaded crypto data
* [top](#top)
* view top coins from coinmarketcap [coinmarketcap.com]


## load <a name="load"></a>
Load a given coin vs a given currency:

````
usage: load [-c --coin] [-d --days] [--vs]
````

Load a given coin vs a given currency. Currently only retrieves price, not volume or MarketCap. The current crypto data is [Powered by CoinGecko API](#https://www.coingecko.com/en), which is an awesome service that currently requires no API Key!

* -c/--coin The coin you wish to load. This can either be the symbol or the name. `load -c btc` and `load -c bitcoin`
will load. The -c flag is optional, the above is equivalent to `load btc`.

* -d/--days The number of days to look. Defaults to 30 days. As per the API: Minutely data will be used for duration within 1 day,
Hourly data will be used for duration between 1 day and 90 days, Daily data will be used for duration above 90 days.

* --vs The currency to look against. Defaults to "usd".

Currently only retrieves price, not volume or MarketCap.

Example doge/eur for the past day:
````
load -c doge -d 1 --vs eur
````

## view <a name="view"></a>
Plot the loaded crypto data.

````
usage: view
````
After loading the above 1 day dogecoin/eur. Running view plots the data:

![doge](https://user-images.githubusercontent.com/18151143/112690617-7832f500-8e52-11eb-84c4-253ab222a918.png)
Plot the loaded crypto data.

![crypto_view](https://user-images.githubusercontent.com/25267873/115787452-20889a80-a3ba-11eb-9216-f7fd1ffc98cf.png)


## top <a name="top"></a>
This command displays the top n cryptocurrencies from coinmarketcap.com. The list appears to be sorted by Mar

````
top [-n] [-s --sort SORTBY] [--descend]
````

This command displays the top n cryptocurrencies from coinmarketcap.com.

* -n: Number of coins to look at (after sort). Defaults to 10.
* -s/--sort : Column to sort by. One of {Symbol,CMC_Rank,LastPrice,DayPctChange,MarketCap}. Defaults to sorting by the CMC rank.
* --descend : Flag to change the sorting order. Sorts in ascending order (since default order is the Rank which starts at 1).

Example usage to get the CMC top 100, then show the top 4 highest Percent Day Change
<img width="990" alt="crypto" src="https://user-images.githubusercontent.com/25267873/115787544-4746d100-a3ba-11eb-9433-b7cb9142404a.png">

![im](https://user-images.githubusercontent.com/18151143/115587223-6bf85700-a29b-11eb-9d96-cb4239b7c2d0.png)
13 changes: 12 additions & 1 deletion gamestonk_terminal/fundamental_analysis/README.md
Expand Up @@ -6,7 +6,9 @@ This menu aims to extract all fundamentals of a pre-loaded company, and the usag
* screen info about the company [Finviz]
* [mgmt](#mgmt)
* management team of the company [Business Insider]

* [score](#score)
* investing score from Warren Buffett, Joseph Piotroski and Benjamin Graham [FMP]

[MARKET WATCH](#MARKET_WATCH)

* [income](#income)
Expand Down Expand Up @@ -323,3 +325,12 @@ Prints the growth of several financial statement items and ratios over time. Thi

* n : Number of latest years/quarters. Default 1.
* q : Quarter fundamental data flag. Default False.


### score <a name="score"></a>

```text
usage: score
```

Value investing tool based on Warren Buffett, Joseph Piotroski and Benjamin Graham thoughts [Source: Financial Modeling Prep]
9 changes: 9 additions & 0 deletions gamestonk_terminal/fundamental_analysis/fa_controller.py
Expand Up @@ -9,6 +9,7 @@
from gamestonk_terminal.fundamental_analysis import business_insider_view as biw
from gamestonk_terminal.fundamental_analysis import (
financial_modeling_prep_controller as fmpc,
financial_modeling_prep_view as fmpv,
)
from gamestonk_terminal.fundamental_analysis import finviz_view
from gamestonk_terminal.fundamental_analysis import market_watch_view
Expand All @@ -26,6 +27,7 @@ class FundamentalAnalysisController:
"help",
"q",
"quit",
"score",
"screener",
"income",
"balance",
Expand Down Expand Up @@ -83,6 +85,9 @@ def print_help(self):
print("")
print(" screener screen info about the company [Finviz]")
print(" mgmt management team of the company [Business Insider]")
print(
" score investing score from Warren Buffett, Joseph Piotroski and Benjamin Graham [FMP]"
)
print("")
print("Market Watch API")
print(" income income statement of the company")
Expand Down Expand Up @@ -137,6 +142,10 @@ def call_screener(self, other_args: List[str]):
""" Process screener command """
finviz_view.screener(other_args, self.ticker)

def call_score(self, other_args: List[str]):
""" Process score command """
fmpv.valinvest_score(other_args, self.ticker)

def call_income(self, other_args: List[str]):
""" Process income command """
market_watch_view.income(other_args, self.ticker)
Expand Down
Expand Up @@ -5,6 +5,7 @@
from typing import List
from datetime import datetime
import pandas as pd
import valinvest
import FundamentalAnalysis as fa # Financial Modeling Prep
from gamestonk_terminal import config_terminal as cfg
from gamestonk_terminal.dataframe_helpers import clean_df_index
Expand All @@ -15,6 +16,40 @@
)


def valinvest_score(other_args: List[str], ticker: str):
"""Value investing tool based on Warren Buffett, Joseph Piotroski and Benjamin Graham thoughts [Source: FMP]
Parameters
----------
other_args : List[str]
argparse other args
ticker : str
Fundamental analysis ticker symbol
"""

parser = argparse.ArgumentParser(
add_help=False,
prog="score",
description="""
Value investing tool based on Warren Buffett, Joseph Piotroski and Benjamin Graham thoughts [Source: FMP]
""",
)

try:
ns_parser = parse_known_args_and_warn(parser, other_args)
if not ns_parser:
return

valstock = valinvest.Fundamental(ticker, cfg.API_KEY_FINANCIALMODELINGPREP)
score = 100 * (valstock.fscore() / 9)
print(f"Score: {score:.2f}".rstrip("0").rstrip(".") + " %")
print("")

except Exception as e:
print(e, "\n")
return


def profile(other_args: List[str], ticker: str):
"""Financial Modeling Prep ticker profile
Expand Down
3 changes: 2 additions & 1 deletion gamestonk_terminal/options/README.md
Expand Up @@ -100,9 +100,10 @@ In order to run, the selenium webdriver must be installed.
Currently, this runs on either Chrome or Firefox. The path to the driver should be defined in [config_terminal.py](#config_terminal.py).

Note this may take more time than other commands to process.

````
usage: info [-d DRIVER]
````
* -d/--driver : One of {chrome, firefox}. This indicates which driver you have installed.

![im](https://user-images.githubusercontent.com/18151143/115454584-efa83a00-a1ee-11eb-9d0f-2558ffa31579.png)
<img width="989" alt="opinfo" src="https://user-images.githubusercontent.com/25267873/115787028-80cb0c80-a3b9-11eb-97a4-ca208aed3be8.png">
21 changes: 13 additions & 8 deletions gamestonk_terminal/options/op_scrape_view.py
Expand Up @@ -5,8 +5,9 @@
from typing import List
from selenium import webdriver
from bs4 import BeautifulSoup
from selenium.webdriver.chrome.options import Options as cOpts
from selenium.webdriver.firefox.options import Options as fOpts

# from selenium.webdriver.chrome.options import Options as cOpts
# from selenium.webdriver.firefox.options import Options as fOpts
import pandas as pd
from tabulate import tabulate
from gamestonk_terminal.config_terminal import (
Expand Down Expand Up @@ -63,14 +64,18 @@ def print_options_data(stock: str, other_args: List[str]):

try:
if browser == "chrome":
options = cOpts()
options.headless = True
driver = webdriver.Chrome(options=options, executable_path=path_to_driver)
# commenting this because it breaks when in usage
# the downside is that the browser will pop up to get the data
# options = cOpts()
# options.headless = True
driver = webdriver.Chrome(executable_path=path_to_driver)

elif browser == "firefox":
options = fOpts()
options.headless = True
driver = webdriver.Firefox(options=options, executable_path=path_to_driver)
# commenting this because it breaks when in usage
# the downside is that the browser will pop up to get the data
# options = fOpts()
# options.headless = True
driver = webdriver.Firefox(executable_path=path_to_driver)

page = f"https://www.barchart.com/stocks/quotes/{stock}/overview"
driver.get(page)
Expand Down

0 comments on commit e3fe8db

Please sign in to comment.