From 67e3b3be13ed58b7736a87f3ee7562e25ba2d79b Mon Sep 17 00:00:00 2001 From: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com> Date: Sun, 26 Jun 2022 23:57:51 +0100 Subject: [PATCH] Add Introduction to Cryptocurrency Guide & Fix crypto/find (#1970) * Add Introduction to Cryptocurrency * Add images * Finish guides * Add images * Fix find not working * Add keywords * Update top_level_menu.md --- guides/crypto/top_level_menu.md | 121 ++++++++++-------- .../cryptocurrency/crypto_controller.py | 44 ++++--- 2 files changed, 93 insertions(+), 72 deletions(-) diff --git a/guides/crypto/top_level_menu.md b/guides/crypto/top_level_menu.md index 75122f8eeaf..f80e39bb94d 100644 --- a/guides/crypto/top_level_menu.md +++ b/guides/crypto/top_level_menu.md @@ -1,68 +1,85 @@ --- -title: Introduction to ENTER_MENU_NAME_HERE -keywords: "ENTER_KEY_WORD_HERE, ENTER_KEY_WORD_HERE, ENTER_KEY_WORD_HERE, ENTER_KEY_WORD_HERE" -date: "YEAR-MONTH-DAY" +title: Introduction to Cryptocurrency +keywords: "crypto, web3, nft, blockchain" +date: "2022-06-20" type: our story status: publish -excerpt: "The Introduction to ENTER_MENU_NAME_HERE explains how to use the -ENTER_MENU_NAME_HERE and provides a brief description of its sub-menus" +excerpt: "The Introduction to Cryptocurrency explains how to use the Cryptocurrency and provides a brief description of its sub-menus" --- -**Important Rules** -Each page should always take the following rules in mind: -- We take a neutral position for everything we show. We don’t say things like ‘This is a good way to’ or ‘This is the gold standard’ or anything similar. These guides are not meant for any form of financial advice, conclusions or perceptions of the market. That is what we can use any social media platform for and write on your own account. -- The page is formal. We don’t include any type of jokes, memes or sarcasm/rhetoric comments. -- We do not explain any financial term but refer to a different source, e.g. Investopedia. -- The purpose of the guide is not to educate the user about how to invest but to explain how to navigate a menu. +# Introduction to Cryptocurrency +The Cryptocurrency menu allows you to discover trending cryptocurrency [(disc)](https://openbb-finance.github.io/OpenBBTerminal/terminal/crypto/disc/). Additionally, you can also perform research of a specific coin [(dd)](https://openbb-finance.github.io/OpenBBTerminal/terminal/crypto/dd/), NFT [(nft)](https://openbb-finance.github.io/OpenBBTerminal/terminal/crypto/nft/) or most lucrative Defi project [(defi)](https://openbb-finance.github.io/OpenBBTerminal/terminal/crypto/defi/). It does so by handing you tools to (among other things) to perform technical analysis [(ta)](https://openbb-finance.github.io/OpenBBTerminal/terminal/crypto/ta/), quantitative analysis [(qa)](https://openbb-finance.github.io/OpenBBTerminal/terminal/crypto/ta/), and give you access to onchain information [(onchain)](https://openbb-finance.github.io/OpenBBTerminal/terminal/crypto/onchain/). -**General Formatting** -- Every link should open a new page (`_blank`). So use: `exp` -- Some methods to format images: - - Side by side: ` ` - - Text and image: - ``` - - - - - - - - - -
TEXT TITLEIMAGE TITLE
TEXTIMAGE
- ``` - - No formatting in particular: `![image](link/to/image)` -_____ +## How to use +The Cryptocurrency menu is called upon by typing `crypto` which opens the following menu: -

Introduction to ENTER_MENU_NAME_HERE

-The purpose of the menu, providing very factual information with a neutral view. E.g. "The Stocks menu is used to -gain insights in the asset class stocks via various areas like fundamental, behavioural and technical analysis" +image -

How to use

-Explain in detail how to use the menu. Sticking with the Stocks menu, you would want to understand how to search and load a -ticker, how you can show the candle and how to explore various different menus.

-Make sure that you link to the Hugo documentation for each command you mention here so people can view in more detail -how the command works exactly. Make use of HTML here so the guides page on the website doesn't close down. +You have the ability to search a coin with `find` based on its name or symbol. An example: -

Sub-menus available

-Provide a brief description of each menu available and include a link to that menu. E.g, the option menu could -have the following: +image -- Introduction to Fundamental Analysis: gives information about the Fundamentals of the chosen ticker. -- Introduction to Behavioural Analysis: gives the abilities to discover how different social media platforms view the chosen company. +As a result, you can see a list of coins matching your search criteria. Once you identify the coin you are looking for, next step is to `load` it. See the example below: -It could be that these menus are so small that it makes sense to include this on the main page as well instead of -creating a sub-menu. +image -

Examples

-Within the Hugo documentation we sometimes already provide examples of how to use a command, e.g. panel -adding one or two examples with more detail here helps explain how one can use some commands. E.g. using some command -in the Stocks menu requires you to load a ticker before you can use it or requires an API Key (where you can refer back to the Getting Started guide) It can be helpful to guide the user -through these steps. What commands you show is completely up to you.

-Make sure to include links to the relevant educational pages, e.g. if you mention 'moving average', use the following -instead: "*The following command calculates the moving average (MA).*" \ No newline at end of file +To view the candle chart for the loaded crypto, you can call `candle`. This will show you the coin's historical prices and volume, as follows: +image + +In case you want to adjust the default period, you can do so by specifying the number of days to go back in time. + +image + +You might be wondering, how can I know about all possible options? You can type in `command_name -h` or `load -h` in this case. Here you will find available optional arguments that you can play with. + +image + + +Lastly, by calling `?` or `help` or `h`, the `crypto` menu will be re-populated. Here you can see that several menus have turned blue, which mean you can enter any of them now. In order to use these menus, you are required to first `load` a coin. +image + + +## Sub-menus available +The Cryptocurrency menu has an extensive list of available sub-menus ranging from due diligence to NFT to onchain analysis. To find more information about each menu, you can click on one of the following: + +- [Introduction to Cryptocurrency Discovery](https://openbb-finance.github.io/OpenBBTerminal/terminal/cryptocurrency/discovery): discovers top trending, top gainers or losers coins, as well as top NFTs, dApps and exchanges based on prices. +- [Introduction to Overview](https://openbb-finance.github.io/OpenBBTerminal/terminal/cryptocurrency/overview/): gives the overview of the cryptocurrency market, including global Defi market, stablecoins, exchanges as well as latest news. +- [Introduction to Onchain](https://openbb-finance.github.io/OpenBBTerminal/terminal/cryptocurrency/onchain/): provides information on different blockchains, whales transaction and traded volumes on certain crypto pair. You can also specify a Ethereum address and look up past transactions and balance history. +- [Introduction to DeFi](https://openbb-finance.github.io/OpenBBTerminal/terminal/cryptocurrency/defi/): explore the decentralized finance market through a variety of indicators and data, from lending interests, staking ratio, Uniswap pools to top Defi dApps. +- [Introduction to Tools](https://openbb-finance.github.io/OpenBBTerminal/terminal/cryptocurrency/tools/): gives you the tool to calculate crypto metrics, such as impermanent loss and converting APR to APY. +- [Introduction to NFTs](https://openbb-finance.github.io/OpenBBTerminal/terminal/cryptocurrency/nft/): Discover latest NFT drops and OpenSea's NFT Collection statistics. +- [Introduction to Due Diligence](https://openbb-finance.github.io/OpenBBTerminal/terminal/cryptocurrency/due_diligence/): performs due diligence on a chosen coin based on, among other things, tokenomics, roadmaps, news, and community. +- [Introduction to Technical Analysis](https://openbb-finance.github.io/OpenBBTerminal/terminal/cryptocurrency/technical_analysis/): analyzes the chosen coin's historical data extensively with moving averages and momentum, trend, volatility and volume indicators. +- [Introduction to Prediction Techniques](https://openbb-finance.github.io/OpenBBTerminal/terminal/cryptocurrency/prediction_techniques/): applies advanced AI and Machine Learning models to form prediction of future stock prices including Recurrent Neural Network (RNN), Autoregressive Integrated Moving Average (ARIMA) and Monte Carlo forecasting + +## Examples + +When entering the `crypto` menu, you would typically want to load in a coin. Let's go with Ethereum. You can do this by specifying its symbol: `load eth` +![image](https://user-images.githubusercontent.com/40023817/175827660-3b106e6e-2638-4536-939e-e38692ec1003.png) + + +Let's checkout its sentiments from major headlines news by typing: `headlines` +image + + +To perform further analysis, the best menu to enter is `dd`. +image + +We can checkout the project's roadmap and its effect to historical price, by typing `rm` + +image + + +Once you have finished analyzing a specific coin, you would want to get a good understanding of the overall crypto market. To do that, head over to `ov` by typing `../ov`. +Hint: `..` basically took you back to the previous menu. Instead of performing 2 separate commands, you can combine them together using `/`. As such `../ov` will take us back to previous menu, and then enter the `ov` menu. + +image + + +Bitcoin has such a big influence on the entire crypto market. So seeing whether we are in a Bitcoin season or a Altcoin season will be useful to your investment decisions. `altindex` is a great command for this purpose. + +image diff --git a/openbb_terminal/cryptocurrency/crypto_controller.py b/openbb_terminal/cryptocurrency/crypto_controller.py index 65a086a6efc..e547f5cf163 100644 --- a/openbb_terminal/cryptocurrency/crypto_controller.py +++ b/openbb_terminal/cryptocurrency/crypto_controller.py @@ -191,25 +191,29 @@ class CryptoController(CryptoBaseController): @log_start_end(log=logger) def call_candle(self, other_args): """Process candle command""" - if self.symbol: - parser = argparse.ArgumentParser( - add_help=False, - formatter_class=argparse.ArgumentDefaultsHelpFormatter, - prog="candle", - description="""Display chart for loaded coin. You can specify currency vs which you want - to show chart and also number of days to get data for.""", - ) - ns_parser = self.parse_known_args_and_warn( - parser, other_args, EXPORT_BOTH_RAW_DATA_AND_FIGURES - ) + parser = argparse.ArgumentParser( + add_help=False, + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + prog="candle", + description="""Display chart for loaded coin. You can specify currency vs which you want + to show chart and also number of days to get data for.""", + ) - if ns_parser: - plot_chart( - symbol=self.symbol, - currency=self.current_currency, - prices_df=self.current_df, - ) + ns_parser = self.parse_known_args_and_warn( + parser, other_args, EXPORT_BOTH_RAW_DATA_AND_FIGURES + ) + + if ns_parser: + if not self.symbol: + console.print("No coin loaded. First use `load {symbol}`\n") + return + + plot_chart( + symbol=self.symbol, + currency=self.current_currency, + prices_df=self.current_df, + ) @log_start_end(log=logger) def call_ta(self, _): @@ -457,16 +461,16 @@ class CryptoController(CryptoBaseController): sources=CRYPTO_SOURCES.keys(), ) # TODO: merge find + display_all_coins - if ns_parser: + if ns_parser.coin: find( - coin=ns_parser.symbol, + coin=ns_parser.coin, source=ns_parser.source, key=ns_parser.key, top=ns_parser.limit, export=ns_parser.export, ) display_all_coins( - coin=ns_parser.symbol, + coin=ns_parser.coin, source=ns_parser.source, top=ns_parser.limit, skip=ns_parser.skip,