Merge pull request #4333 from OpenBB-finance/hotfix/4095

Add reverse fx choices to forex load
This commit is contained in:
James Maslek
2023-02-26 20:08:42 +00:00
committed by GitHub

View File

@@ -37,7 +37,8 @@ logger = logging.getLogger(__name__)
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 = list(set(tickers + [t[-3:] + t[:3] for t in tickers if len(t) == 6]))
class ForexController(BaseController):
@@ -73,7 +74,6 @@ class ForexController(BaseController):
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)