From 045168e5a29008bb49a7d45905fa179498ed841b Mon Sep 17 00:00:00 2001 From: jose-donato <43375532+jose-donato@users.noreply.github.com> Date: Sun, 24 Jul 2022 15:06:56 +0100 Subject: [PATCH] Updates crypto load docs to match last load refactor (#2154) * fix load docs * fix vol days --- .../cryptocurrency/cryptocurrency_helpers.py | 4 +- .../content/terminal/crypto/load/_index.md | 50 +++---------------- 2 files changed, 8 insertions(+), 46 deletions(-) diff --git a/openbb_terminal/cryptocurrency/cryptocurrency_helpers.py b/openbb_terminal/cryptocurrency/cryptocurrency_helpers.py index c21a7e84caf..4149238cfec 100644 --- a/openbb_terminal/cryptocurrency/cryptocurrency_helpers.py +++ b/openbb_terminal/cryptocurrency/cryptocurrency_helpers.py @@ -292,7 +292,7 @@ def load( vs: str = "usd", days: int = 365, ): - """Load crypto currency to perform analysis on. CoinGecko is used as source for price and YahooFinance for volume. + """Load crypto currency to perform analysis on CoinGecko is used as source for price and YahooFinance for volume. Parameters ---------- @@ -357,7 +357,7 @@ def show_quick_performance(crypto_df: pd.DataFrame, symbol: str, current_currenc df = df.applymap(lambda x: f"[red]{x}[/red]" if "-" in x else f"[green]{x}[/green]") if len(closes) > 365: df["Volatility (1Y)"] = ( - str(round(100 * np.sqrt(365) * closes[:-365].pct_change().std(), 2)) + " %" + str(round(100 * np.sqrt(365) * closes[-365:].pct_change().std(), 2)) + " %" ) else: df["Volatility (Ann)"] = ( diff --git a/website/content/terminal/crypto/load/_index.md b/website/content/terminal/crypto/load/_index.md index 4150ef4ad75..d9838b1cb9c 100644 --- a/website/content/terminal/crypto/load/_index.md +++ b/website/content/terminal/crypto/load/_index.md @@ -1,52 +1,14 @@ ``` -usage: load [-c COIN] [--source {cp,cg,bin,cb}] [-s START] [--vs VS] [-i INTERVAL] [-h] +usage: load [-c COIN] [-d {1,7,14,30,90,180,365}] [--vs {usd,eur}] [-h] ``` -Load crypto currency to perform analysis on. Available data sources are CoinGecko, CoinPaprika, Binance, Coinbase. By default main source used for analysis is CoinGecko (cg). To change it use --source flag. +Load crypto currency to perform analysis on CoinGecko is used as source for price and YahooFinance for volume. ``` optional arguments: - -c COIN, --coin COIN Coin to get (default: None) - --source {cp,cg,bin,cb} - Source of data (default: cg) - -s START, --start START - The starting date (format YYYY-MM-DD) of the crypto (default: 2021-02-14) - --vs VS Quote currency (what to view coin vs) (default: usd) - -i INTERVAL, --interval INTERVAL - Interval to get data (Only available on binance/coinbase) (default: 1day) + -c COIN, --coin COIN Coin to get. Must be coin symbol (e.g., btc, eth) (default: None) + -d {1,7,14,30,90,180,365}, --days {1,7,14,30,90,180,365} + Data up to number of days ago (default: 365) + --vs {usd,eur} Quote currency (what to view coin vs) (default: usd) -h, --help show this help message (default: False) ``` - -All the sources share the arguments specified above but `--interval` and `--vs` differ from source to source. - -For CoinPaprika and CoinGecko are similar: - -``` - --vs VS The currency to look the loaded coin against. Both USD and BTC are supported. Default: `USD` - -i/--interval Interval to look data for. These two sources only support daily data. Default: `1day` -``` - -For Coinbase: - -``` - --vs VS The currency to look the loaded coin against. Depends on the crypto loaded. Default: `USDT` - -i/--interval Interval to look data for. Default is `1day` but support all of the following: ['1min', '5min', '15min', '1hour', '6hour', '24hour', '1day'] -``` - -For Binance: - -``` - --vs VS The currency to look the loaded coin against. Depends on the crypto loaded. Default: `USDT` - -i/--interval Interval to look data for. Default is `1day` but support all of the following: ['1day', '3day', '1hour', '2hour', '4hour', '6hour', '8hour', '12hour', '1week', '1min', '3min', '5min', '15min', '30min', '1month'] -``` - -An example: -``` -2022 Feb 15, 05:51 (✨) /crypto/ $ load BTC - -Loaded bitcoin against usd from CoinGecko source - -Current Price: 44225.18 USD -Performance in interval (1day): 4.68% -Performance since 2021-02-14: -9.02% -```