requested changes

This commit is contained in:
DJ
2021-04-25 07:40:54 -06:00
parent ed4162c057
commit 27e9fe3db8
3 changed files with 20 additions and 49 deletions

View File

@@ -137,11 +137,11 @@ Retrieve a candlestick chart for the currently loaded instrument. Not a live cha
* -c : Specify the number of candles to retrieve. (default=180)
* -a : Adds AD (Accumulation/Distribution Index) to the chart. AD is a cumulative indicator that uses volume and price to assess whether a stock is being accumulated or distributed. This provides insight into how strong a trend is. [Investopedia](#https://www.investopedia.com/terms/a/accumulationdistribution.asp)
* -b : Adds Bollinger Bands to the chart. Bollinger bands are a set of trendlines plotted two standard deviations (positively and negatively) away from a simple moving average of a security's price. [Investopedia](#https://www.investopedia.com/terms/b/bollingerbands.asp)
* -C : Adds CCI (Commodity Channel Index) to the chart. CCI is a momentum-based oscillator used to help determine when an investment vehicle is reaching a condition of being overbought or oversold. [Investopedia](#https://www.investopedia.com/terms/c/commoditychannelindex.asp)
* -e : Adds EMA (Exponential Moving Average) to the chart. EMA is a moving average that places a greater weight and significance on the most recent data points. [Investopedia](#https://www.investopedia.com/terms/e/ema.asp)
* -C : Adds CCI (Commodity Channel Index) to the chart. CCI is a momentum-based oscillator used to help determine when an investment vehicle is reaching a condition of being overbought or oversold. (default=14) [Investopedia](#https://www.investopedia.com/terms/c/commoditychannelindex.asp)
* -e : Adds EMA (Exponential Moving Average) to the chart. EMA is a moving average that places a greater weight and significance on the most recent data points. (default=10) [Investopedia](#https://www.investopedia.com/terms/e/ema.asp)
* -o : Adds OBV (On Balance Volume) to the chart. OBV is a momentum indicator that uses volume flow to predict changes in price. [Investopedia](#https://www.investopedia.com/terms/o/onbalancevolume.asp)
* -r : Adds RSI (Relative Strength Index) to the chart. RSI is a momentum indicator that measures the magnitude of recent price changes to evaluate overbought or oversold conditions. [Investopedia](#https://www.investopedia.com/terms/r/rsi.asp)
* -s : Adds SMA (Simple Moving Average) to the chart. SMA calculates the average of a selected range of prices, usually closing prices, by the number of periods in that range. [Investopedia](#https://www.investopedia.com/terms/s/sma.asp)
* -r : Adds RSI (Relative Strength Index) to the chart. RSI is a momentum indicator that measures the magnitude of recent price changes to evaluate overbought or oversold conditions. (default=14) [Investopedia](#https://www.investopedia.com/terms/r/rsi.asp)
* -s : Adds SMA (Simple Moving Average) to the chart. SMA calculates the average of a selected range of prices, usually closing prices, by the number of periods in that range. (defaults= 20, 50) [Investopedia](#https://www.investopedia.com/terms/s/sma.asp)
* -v : Adds VWAP (Volume Weighted Average Price) to the chart. VWAP gives the average price a security has traded at throughout the day, based on both volume and price. [Investopedia](#https://www.investopedia.com/terms/v/vwap.asp)
## price <a name="price"></a>

View File

@@ -7,8 +7,10 @@ from gamestonk_terminal.menu import session
from gamestonk_terminal.forex import fx_view
from gamestonk_terminal import config_terminal as cfg
from gamestonk_terminal.due_diligence import news_view, reddit_view
from gamestonk_terminal.behavioural_analysis import stocktwits_view, twitter_view
from gamestonk_terminal.exploratory_data_analysis import eda_api
from gamestonk_terminal.behavioural_analysis import stocktwits_view
from gamestonk_terminal.exploratory_data_analysis import eda_controller
import pandas as pd
account = cfg.OANDA_ACCOUNT
@@ -38,13 +40,7 @@ class ForexController:
"bullbear",
"messages",
"reddit",
"infer",
"sentiment",
"edasummary",
"edarolling",
"edadecompose",
"edacusum",
"edahist",
"eda",
]
def __init__(self):
@@ -94,16 +90,8 @@ class ForexController:
" reddit search reddit for posts about the loaded instrument"
)
print(
" edasummary brief summary statistics using exploratory data analysis"
" eda exploratory data analysis, e.g.: decompose, cusum, residuals analysis"
)
print(" edarolling rolling mean and std deviation")
print(
" edadecompose decomposition in cyclic-trend, season, and residuals"
)
print(
" edacusum detects abrupt changes using cumulative sum algorithm"
)
print("")
def switch(self, an_input: str):
@@ -191,44 +179,27 @@ class ForexController:
"""Call news [News API]"""
news_view.news(other_args, self.instrument)
def call_bullbear(self, other_args):
def call_bullbear(self, other_args: List[str]):
"""Call bullbear fom stocktwits"""
instrument = fx_view.format_instrument(self.instrument, " ")
stocktwits_view.bullbear(other_args, instrument)
def call_messages(self, other_args):
def call_messages(self, other_args: List[str]):
"""Call messages from stocktwits"""
instrument = fx_view.format_instrument(self.instrument, " ")
stocktwits_view.messages(other_args, instrument)
def call_edasummary(self, other_args: List[str]):
df = fx_view.get_candles_dataframe(account, self.instrument, None)
eda_api.summary(other_args, df)
def call_edarolling(self, other_args: List[str]):
df = fx_view.get_candles_dataframe(account, self.instrument, None)
df.columns = ["Open", "Low", "High", "5. adjusted close", "Volume"]
eda_api.rolling(other_args, self.instrument, df)
def call_edadecompose(self, other_args: List[str]):
df = fx_view.get_candles_dataframe(account, self.instrument, None)
df.columns = ["Open", "Low", "High", "5. adjusted close", "Volume"]
eda_api.decompose(other_args, self.instrument, df)
def call_edacusum(self, other_args: List[str]):
df = fx_view.get_candles_dataframe(account, self.instrument, None)
df.columns = ["Open", "Low", "High", "5. adjusted close", "Volume"]
eda_api.cusum(other_args, self.instrument, df)
def call_reddit(self, other_args: List[str]):
instrument = fx_view.format_instrument(self.instrument, " ")
reddit_view.due_diligence(other_args, instrument)
def call_infer(self, other_args: List[str]):
twitter_view.inference(other_args, self.instrument)
def call_sentiment(self, other_args: List[str]):
twitter_view.sentiment(other_args, self.instrument)
def call_eda(self, other_args):
df = fx_view.get_candles_dataframe(account, self.instrument, None)
df = df.rename(columns={"Close": "5. adjusted close"})
instrument = self.instrument
s_start = pd.to_datetime(df.index.values[0])
s_interval = "1440min"
eda_controller.menu(df, instrument, s_start, s_interval)
def menu():

View File

@@ -645,7 +645,7 @@ def add_plots(df, ns_parser):
ema = ta.ema(df["Close"])
ema_plot = mpf.make_addplot(ema, panel=0)
plots_to_add.append(ema_plot)
legends.append("20 EMA")
legends.append("10 EMA")
if ns_parser.rsi:
rsi = ta.rsi(df["Close"])