mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-29 21:42:22 +00:00
Updates crypto load docs to match last load refactor (#2154)
* fix load docs * fix vol days
This commit is contained in:
@@ -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)"] = (
|
||||
|
||||
50
website/content/terminal/crypto/load/_index.md
vendored
50
website/content/terminal/crypto/load/_index.md
vendored
@@ -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%
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user