Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates crypto load docs to match last load refactor #2154

Merged
merged 3 commits into from
Jul 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openbb_terminal/cryptocurrency/cryptocurrency_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand Down Expand Up @@ -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)"] = (
Expand Down
50 changes: 6 additions & 44 deletions website/content/terminal/crypto/load/_index.md
Original file line number Diff line number Diff line change
@@ -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%
```