From 557848d0b585ddfde9e0ed5a0ca131362045334a Mon Sep 17 00:00:00 2001 From: Diogo Sousa Date: Sat, 25 Feb 2023 19:33:35 +0000 Subject: [PATCH 1/4] add reverse fx choices --- openbb_terminal/forex/forex_controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openbb_terminal/forex/forex_controller.py b/openbb_terminal/forex/forex_controller.py index 1ef383d19c73..cb57e0c4aac8 100644 --- a/openbb_terminal/forex/forex_controller.py +++ b/openbb_terminal/forex/forex_controller.py @@ -37,7 +37,8 @@ forex_data_path = os.path.join( os.path.dirname(__file__), os.path.join("data", "polygon_tickers.csv") ) -FX_TICKERS = pd.read_csv(forex_data_path).iloc[:, 0].to_list() +tickers = pd.read_csv(forex_data_path).iloc[:, 0].to_list() +FX_TICKERS = tickers + [t[-3:]+t[:3] for t in tickers] class ForexController(BaseController): @@ -73,7 +74,6 @@ def __init__(self, queue: Optional[List[str]] = None): if session and obbff.USE_PROMPT_TOOLKIT: choices: dict = self.choices_default - choices["load"].update({c: {} for c in FX_TICKERS}) self.completer = NestedCompleter.from_nested_dict(choices) From f2e90b2d4d85252541af14acdcbcefc510e9c529 Mon Sep 17 00:00:00 2001 From: Diogo Sousa Date: Sat, 25 Feb 2023 19:33:53 +0000 Subject: [PATCH 2/4] black --- openbb_terminal/forex/forex_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbb_terminal/forex/forex_controller.py b/openbb_terminal/forex/forex_controller.py index cb57e0c4aac8..45281dfb44a8 100644 --- a/openbb_terminal/forex/forex_controller.py +++ b/openbb_terminal/forex/forex_controller.py @@ -38,7 +38,7 @@ os.path.dirname(__file__), os.path.join("data", "polygon_tickers.csv") ) tickers = pd.read_csv(forex_data_path).iloc[:, 0].to_list() -FX_TICKERS = tickers + [t[-3:]+t[:3] for t in tickers] +FX_TICKERS = tickers + [t[-3:] + t[:3] for t in tickers] class ForexController(BaseController): From 5053a0a08fdc02587c936acabd3ec88d28de2e02 Mon Sep 17 00:00:00 2001 From: Diogo Sousa Date: Sun, 26 Feb 2023 17:07:34 +0000 Subject: [PATCH 3/4] len & set --- openbb_terminal/forex/forex_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbb_terminal/forex/forex_controller.py b/openbb_terminal/forex/forex_controller.py index 45281dfb44a8..db77f6ef5283 100644 --- a/openbb_terminal/forex/forex_controller.py +++ b/openbb_terminal/forex/forex_controller.py @@ -38,7 +38,7 @@ os.path.dirname(__file__), os.path.join("data", "polygon_tickers.csv") ) tickers = pd.read_csv(forex_data_path).iloc[:, 0].to_list() -FX_TICKERS = tickers + [t[-3:] + t[:3] for t in tickers] +FX_TICKERS = tickers + list(set([t[-3:] + t[:3] for t in tickers if len(t) == 6])) class ForexController(BaseController): From 112403e176e48a03123270732d40f67307a3c2c1 Mon Sep 17 00:00:00 2001 From: Diogo Sousa Date: Sun, 26 Feb 2023 17:09:40 +0000 Subject: [PATCH 4/4] set all list --- openbb_terminal/forex/forex_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbb_terminal/forex/forex_controller.py b/openbb_terminal/forex/forex_controller.py index db77f6ef5283..1be022c09dd3 100644 --- a/openbb_terminal/forex/forex_controller.py +++ b/openbb_terminal/forex/forex_controller.py @@ -38,7 +38,7 @@ os.path.dirname(__file__), os.path.join("data", "polygon_tickers.csv") ) tickers = pd.read_csv(forex_data_path).iloc[:, 0].to_list() -FX_TICKERS = tickers + list(set([t[-3:] + t[:3] for t in tickers if len(t) == 6])) +FX_TICKERS = list(set(tickers + [t[-3:] + t[:3] for t in tickers if len(t) == 6])) class ForexController(BaseController):