mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-30 05:52:23 +00:00
Fixes in crypto and reports menu (#863)
* fix: ta menu displayed stocks label instead of crypto * fix: coinbase loaded data in reverse, increase days to 60 for ema * fix: added vscode integrated terminal python version to troubleshoot * fix: print notifying jupyter notebook launch * fix: greyed volume menus if volume is not present * fix: greyed vwap if volume is not present
This commit is contained in:
38
TROUBLESHOOT.md
vendored
38
TROUBLESHOOT.md
vendored
@@ -1,4 +1,3 @@
|
||||
|
||||
# TROUBLESHOOT
|
||||
|
||||
If you are visiting this page it means that you're having issues installing. We deeply apologize for that.
|
||||
@@ -36,7 +35,6 @@ Since the start of the project we've come across different types of issues exper
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
|
||||
## Standard Install Troubles
|
||||
|
||||
### Microsoft Visual C++
|
||||
@@ -44,12 +42,10 @@ Since the start of the project we've come across different types of issues exper
|
||||
If your terminal has too many red error lines, it is likely that this is the issue. Go to this page and install the c++ build tools:
|
||||
https://answers.microsoft.com/en-us/windows/forum/windows_other-windows_install/microsoft-visual-c-140/6f0726e2-6c32-4719-9fe5-aa68b5ad8e6d
|
||||
|
||||
|
||||
### Wheel
|
||||
|
||||
`conda install -c conda-forge wheel` or `pip install wheel`
|
||||
|
||||
|
||||
### Cvxpy
|
||||
|
||||
```
|
||||
@@ -63,6 +59,7 @@ pip install --upgrade numpy==1.20.2
|
||||
```
|
||||
|
||||
### Poetry
|
||||
|
||||
If you get errors about .whl files not existing (usually on Windows) you have to reinitialize the following folder.
|
||||
Just removing the 'artifacts' folder could also be enough:
|
||||
|
||||
@@ -98,27 +95,31 @@ If you run into trouble with Poetry, and the advice above did not help, your bes
|
||||
|
||||
### General
|
||||
|
||||
In the case when you run into an error of the form `ModuleNotFoundError: No module named '_______'`. The solution is to
|
||||
In the case when you run into an error of the form `ModuleNotFoundError: No module named '_______'`. The solution is to
|
||||
install the missing package via pip.
|
||||
|
||||
If you get the error that `yfinance` is not found, you would run
|
||||
* `pip install yfinance`
|
||||
|
||||
- `pip install yfinance`
|
||||
|
||||
Then please submit an issue so that we can address why that was not imported.
|
||||
|
||||
Please note that the package `pmdarima` needs to installed through `pip install` and not through `conda install`.
|
||||
|
||||
### pypfopt
|
||||
|
||||
```
|
||||
pip install PyPortfolioOpt
|
||||
```
|
||||
|
||||
### dotenv
|
||||
|
||||
```
|
||||
pip install python-dotenv
|
||||
```
|
||||
|
||||
### ally
|
||||
|
||||
```
|
||||
pip install pyally
|
||||
```
|
||||
@@ -133,27 +134,40 @@ poetry install
|
||||
poetry install -E prediction
|
||||
```
|
||||
|
||||
*Commands that may help you in case of an error:*
|
||||
|
||||
* `python -m pip install --upgrade pip`
|
||||
* `pip install pystan --upgrade`
|
||||
* `poetry update --lock`
|
||||
_Commands that may help you in case of an error:_
|
||||
|
||||
- `python -m pip install --upgrade pip`
|
||||
- `pip install pystan --upgrade`
|
||||
- `poetry update --lock`
|
||||
|
||||
## Other Issues
|
||||
|
||||
### CRLF versus LF
|
||||
|
||||
When trying to commit code changes, pylint will prevent you from doing so if your line break settings are set to
|
||||
CRLF (default for Windows). This is because the entire package uses LF (default for Linux/Mac), and it is therefore
|
||||
important that you change this setting to LF *before* you make any changes to the code.
|
||||
important that you change this setting to LF _before_ you make any changes to the code.
|
||||
|
||||
It is possible that CRLF automatically turns back on, you can correct this with:
|
||||
|
||||
```
|
||||
git config --global core.autocrlf false
|
||||
```
|
||||
|
||||
In case you already made coding adjustments, you have to reset your cache, and the changes you made to the code with
|
||||
the following:
|
||||
|
||||
```
|
||||
git rm --cached -r .
|
||||
git reset --hard
|
||||
```
|
||||
|
||||
### Unable to run gst from VS Code integrated terminal
|
||||
|
||||
Occurs when vscode terminal python version/path is different from the terminal version.
|
||||
|
||||
To fix it add this to vscode JSON settings ([ref](https://stackoverflow.com/questions/54582361/vscode-terminal-shows-incorrect-python-version-and-path-launching-terminal-from)):
|
||||
|
||||
```
|
||||
"terminal.integrated.inheritEnv": false,
|
||||
```
|
||||
|
||||
@@ -422,7 +422,7 @@ What do you want to do?
|
||||
prog="ta",
|
||||
description="""Loads data for technical analysis. You can specify currency vs which you want
|
||||
to show chart and also number of days to get data for.
|
||||
By default currency: usd and days: 30.
|
||||
By default currency: usd and days: 60.
|
||||
E.g. if you loaded in previous step Ethereum and you want to see it's price vs btc
|
||||
in last 90 days range use `ta --vs btc --days 90`""",
|
||||
)
|
||||
@@ -440,7 +440,7 @@ What do you want to do?
|
||||
parser.add_argument(
|
||||
"-d",
|
||||
"--days",
|
||||
default=30,
|
||||
default=60,
|
||||
dest="days",
|
||||
help="Number of days to get data for",
|
||||
type=check_positive,
|
||||
@@ -454,7 +454,7 @@ What do you want to do?
|
||||
parser.add_argument(
|
||||
"-d",
|
||||
"--days",
|
||||
default=30,
|
||||
default=60,
|
||||
dest="days",
|
||||
help="Number of days to get data for",
|
||||
)
|
||||
|
||||
@@ -496,7 +496,7 @@ def load_ta_data(
|
||||
)
|
||||
candles_df = pd.DataFrame(candles).astype(float).iloc[:, :6]
|
||||
candles_df.columns = [
|
||||
"Time0",
|
||||
"date",
|
||||
"Open",
|
||||
"High",
|
||||
"Low",
|
||||
@@ -504,8 +504,8 @@ def load_ta_data(
|
||||
"Volume",
|
||||
]
|
||||
df_coin = candles_df.set_index(
|
||||
pd.to_datetime(candles_df["Time0"], unit="ms")
|
||||
).drop("Time0", axis=1)
|
||||
pd.to_datetime(candles_df["date"], unit="ms")
|
||||
).drop("date", axis=1)
|
||||
|
||||
return df_coin, currency
|
||||
return pd.DataFrame(), currency
|
||||
@@ -519,14 +519,14 @@ def load_ta_data(
|
||||
|
||||
df.drop(["time_close", "market_cap"], axis=1, inplace=True)
|
||||
df.columns = [
|
||||
"Time0",
|
||||
"date",
|
||||
"Open",
|
||||
"High",
|
||||
"Low",
|
||||
"Close",
|
||||
"Volume",
|
||||
]
|
||||
df = df.set_index(pd.to_datetime(df["Time0"])).drop("Time0", axis=1)
|
||||
df = df.set_index(pd.to_datetime(df["date"])).drop("date", axis=1)
|
||||
return df, currency
|
||||
|
||||
if source == "cg":
|
||||
@@ -555,10 +555,11 @@ def load_ta_data(
|
||||
interval=interval or "24hour",
|
||||
).head(limit)
|
||||
|
||||
df_coin = df.set_index(pd.to_datetime(df["Time0"], unit="s")).drop(
|
||||
"Time0", axis=1
|
||||
df_coin = df.set_index(pd.to_datetime(df["date"], unit="s")).drop(
|
||||
"date", axis=1
|
||||
)
|
||||
return df_coin, currency
|
||||
|
||||
return df_coin[::-1], currency
|
||||
|
||||
return pd.DataFrame(), currency
|
||||
|
||||
@@ -628,7 +629,7 @@ def plot_chart(
|
||||
)
|
||||
candles_df = pd.DataFrame(candles).astype(float).iloc[:, :6]
|
||||
candles_df.columns = [
|
||||
"Time0",
|
||||
"date",
|
||||
"Open",
|
||||
"High",
|
||||
"Low",
|
||||
@@ -636,8 +637,8 @@ def plot_chart(
|
||||
"Volume",
|
||||
]
|
||||
df_coin = candles_df.set_index(
|
||||
pd.to_datetime(candles_df["Time0"], unit="ms")
|
||||
).drop("Time0", axis=1)
|
||||
pd.to_datetime(candles_df["date"], unit="ms")
|
||||
).drop("date", axis=1)
|
||||
|
||||
plot_candles(
|
||||
df_coin,
|
||||
@@ -654,14 +655,14 @@ def plot_chart(
|
||||
|
||||
df.drop(["time_close", "market_cap"], axis=1, inplace=True)
|
||||
df.columns = [
|
||||
"Time0",
|
||||
"date",
|
||||
"Open",
|
||||
"High",
|
||||
"Low",
|
||||
"Close",
|
||||
"Volume",
|
||||
]
|
||||
df = df.set_index(pd.to_datetime(df["Time0"])).drop("Time0", axis=1)
|
||||
df = df.set_index(pd.to_datetime(df["date"])).drop("date", axis=1)
|
||||
title = (
|
||||
f"\n{coin}/{currency} from {df.index[0].strftime('%Y/%m/%d')} to {df.index[-1].strftime('%Y/%m/%d')}",
|
||||
)
|
||||
@@ -737,10 +738,8 @@ def plot_chart(
|
||||
interval=interval or "24hour",
|
||||
).head(limit)
|
||||
df = df.astype(float).iloc[:, :6]
|
||||
df.sort_values(by="Time0", inplace=True, ascending=True)
|
||||
df = df.set_index(pd.to_datetime(df["Time0"], unit="s")).drop(
|
||||
"Time0", axis=1
|
||||
)
|
||||
df.sort_values(by="date", inplace=True, ascending=True)
|
||||
df = df.set_index(pd.to_datetime(df["date"], unit="s")).drop("date", axis=1)
|
||||
|
||||
title = (
|
||||
f"\n{coin}/{currency} from {df.index[0].strftime('%Y/%m/%d')} to {df.index[-1].strftime('%Y/%m/%d')}",
|
||||
|
||||
@@ -152,7 +152,7 @@ def get_candles(product_id: str, interval: str = "24h") -> pd.DataFrame:
|
||||
)
|
||||
df = pd.DataFrame(candles)
|
||||
df.columns = [
|
||||
"Time0",
|
||||
"date",
|
||||
"Low",
|
||||
"High",
|
||||
"Open",
|
||||
@@ -161,7 +161,7 @@ def get_candles(product_id: str, interval: str = "24h") -> pd.DataFrame:
|
||||
]
|
||||
return df[
|
||||
[
|
||||
"Time0",
|
||||
"date",
|
||||
"Open",
|
||||
"High",
|
||||
"Low",
|
||||
|
||||
@@ -6,6 +6,7 @@ import argparse
|
||||
import os
|
||||
from typing import List
|
||||
from datetime import datetime
|
||||
from colorama import Style
|
||||
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
@@ -69,6 +70,8 @@ class TechnicalAnalysisController:
|
||||
self.start = start
|
||||
self.interval = interval
|
||||
self.stock = stock
|
||||
self.stock["Adj Close"] = stock["Close"]
|
||||
print(self.stock)
|
||||
|
||||
self.ta_parser = argparse.ArgumentParser(add_help=False, prog="ta")
|
||||
self.ta_parser.add_argument(
|
||||
@@ -80,10 +83,12 @@ class TechnicalAnalysisController:
|
||||
"""Print help"""
|
||||
s_intraday = (f"Intraday {self.interval}", "Daily")[self.interval == "1440min"]
|
||||
if self.start:
|
||||
stock_str = f"\n{s_intraday} Stock: {self.ticker} (from {self.start.strftime('%Y-%m-%d')})"
|
||||
stock_str = f"\n{s_intraday} Crypto: {self.ticker} (from {self.start.strftime('%Y-%m-%d')})"
|
||||
else:
|
||||
stock_str = f"\n{s_intraday} Stock: {self.ticker}"
|
||||
stock_str = f"\n{s_intraday} Crypto: {self.ticker}"
|
||||
|
||||
dim = Style.DIM if "Volume" not in self.stock else ""
|
||||
not_dim = Style.RESET_ALL if "Volume" not in self.stock else ""
|
||||
help_str = f"""
|
||||
{stock_str}
|
||||
|
||||
@@ -96,8 +101,8 @@ Technical Analysis:
|
||||
Overlap:
|
||||
ema exponential moving average
|
||||
sma simple moving average
|
||||
zlma zero lag moving average"
|
||||
vwap volume weighted average price
|
||||
zlma zero lag moving average{dim}
|
||||
vwap volume weighted average price{not_dim}
|
||||
Momentum:
|
||||
cci commodity channel index
|
||||
macd moving average convergence/divergence
|
||||
@@ -110,10 +115,10 @@ Trend:
|
||||
aroon aroon indicator
|
||||
Volatility:
|
||||
bbands bollinger bands
|
||||
donchian donchian channels
|
||||
donchian donchian channels{dim}
|
||||
Volume:
|
||||
ad accumulation/distribution line values
|
||||
obv on balance volume
|
||||
obv on balance volume{not_dim}
|
||||
Custom:
|
||||
fib fibonacci retracement
|
||||
"""
|
||||
@@ -1243,11 +1248,11 @@ def menu(ticker: str, start: datetime, interval: str, stock: pd.DataFrame):
|
||||
{c: None for c in ta_controller.CHOICES}
|
||||
)
|
||||
an_input = session.prompt(
|
||||
f"{get_flair()} (stocks)>(ta)> ",
|
||||
f"{get_flair()} (crypto)>(ta)> ",
|
||||
completer=completer,
|
||||
)
|
||||
else:
|
||||
an_input = input(f"{get_flair()} (stocks)>(ta)> ")
|
||||
an_input = input(f"{get_flair()} (crypto)>(ta)> ")
|
||||
|
||||
try:
|
||||
plt.close("all")
|
||||
|
||||
@@ -217,11 +217,16 @@ def menu():
|
||||
report_controller.print_help()
|
||||
|
||||
# Initialize jupyter notebook
|
||||
|
||||
cmd = f"jupyter notebook --port={config_terminal.PAPERMILL_NOTEBOOK_REPORT_PORT}"
|
||||
proc = subprocess.Popen(
|
||||
cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
|
||||
)
|
||||
|
||||
print(
|
||||
f"Jupyter notebook environment launched on http://localhost:{config_terminal.PAPERMILL_NOTEBOOK_REPORT_PORT}\n"
|
||||
)
|
||||
|
||||
while True:
|
||||
# Get input command from user
|
||||
if session and gtff.USE_PROMPT_TOOLKIT:
|
||||
|
||||
Reference in New Issue
Block a user