diff --git a/i18n/en.yml b/i18n/en.yml index 683ce4738fb..d0f41dbc3d0 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -796,6 +796,7 @@ en: forex/ta: technical analysis, ema, macd, rsi, adx, bbands, obv forex/qa: quantitative analysis, decompose, cusum, residuals analysis forex/forex: Forex brokerages + forex/forecast: forecast techniques forex/oanda: Oanda menu forex/ta/_currency: Currency pair loaded forex/ta/_source: Source diff --git a/openbb_terminal/forex/forex_controller.py b/openbb_terminal/forex/forex_controller.py index 5f0ddee753b..381e735b84b 100644 --- a/openbb_terminal/forex/forex_controller.py +++ b/openbb_terminal/forex/forex_controller.py @@ -45,7 +45,7 @@ FX_TICKERS = pd.read_csv(forex_data_path).iloc[:, 0].to_list() class ForexController(BaseController): """Forex Controller class.""" - CHOICES_COMMANDS = ["load", "quote", "candle", "resources", "fwd"] + CHOICES_COMMANDS = ["load", "quote", "candle", "resources", "fwd", "forecast"] CHOICES_MENUS = ["ta", "qa", "Oanda"] RESOLUTION = ["i", "d", "w", "m"] @@ -102,6 +102,7 @@ class ForexController(BaseController): mt.add_raw("\n") mt.add_info("forex") mt.add_menu("oanda") + mt.add_menu("forecast") console.print(text=mt.menu_text, menu="Forex") def custom_reset(self): @@ -315,14 +316,7 @@ class ForexController(BaseController): """Enter Oanda menu.""" from openbb_terminal.forex.oanda.oanda_controller import OandaController - # if self.to_symbol and self.from_symbol: - - self.queue = self.load_class( - OandaController, - queue=self.queue, - ) - # else: - # console.print("No currency pair data is loaded. Use 'load' to load data.\n") + self.queue = self.load_class(OandaController, queue=self.queue) @log_start_end(log=logger) def call_ta(self, _): @@ -367,10 +361,14 @@ class ForexController(BaseController): else: console.print("No pair selected.\n") - # HELP WANTED! - # TODO: Add news and reddit commands back - # behavioural analysis and exploratory data analysis would be useful in the - # forex menu. The examples of integration of the common ba and eda components - # into the stocks context can provide an insight on how this can be done. - # The earlier implementation did not work and was deleted in commit - # d0e51033f7d5d4da6386b9e0b787892979924dce + @log_start_end(log=logger) + def call_forecast(self, _): + """Process forecast command""" + from openbb_terminal.forecast import forecast_controller + + self.queue = self.load_class( + forecast_controller.ForecastController, + self.fx_pair, + self.data, + self.queue, + ) diff --git a/openbb_terminal/stocks/stocks_controller.py b/openbb_terminal/stocks/stocks_controller.py index c77ff3a19fa..fb7295c934e 100644 --- a/openbb_terminal/stocks/stocks_controller.py +++ b/openbb_terminal/stocks/stocks_controller.py @@ -167,10 +167,9 @@ class StocksController(StockBaseController): s_intraday = (f"Intraday {self.interval}", "Daily")[ self.interval == "1440min" ] + stock_text += f"{s_intraday} {self.ticker}" if self.start: - stock_text = f"{s_intraday} {self.ticker} (from {self.start.strftime('%Y-%m-%d')})" - else: - stock_text = f"{s_intraday} {self.ticker}" + stock_text += f" (from {self.start.strftime('%Y-%m-%d')})" mt = MenuText("stocks/", 100) mt.add_cmd("search") @@ -743,8 +742,6 @@ class StocksController(StockBaseController): self.stock, self.queue, ) - # TODO: This menu should work regardless of data being daily or not! - # James: 5/27 I think it does now else: console.print("Use 'load ' prior to this command!", "\n") diff --git a/tests/openbb_terminal/forex/txt/test_forex_controller/test_print_help.txt b/tests/openbb_terminal/forex/txt/test_forex_controller/test_print_help.txt index 22b3aacec91..2cc9a286434 100644 --- a/tests/openbb_terminal/forex/txt/test_forex_controller/test_print_help.txt +++ b/tests/openbb_terminal/forex/txt/test_forex_controller/test_print_help.txt @@ -12,4 +12,5 @@ Source: YahooFinance Forex brokerages: > oanda Oanda menu +> forecast forecast techniques