Skip to content

Commit

Permalink
add --india flag to stocks/load (#5281)
Browse files Browse the repository at this point in the history
* add `--india` flag to `stocks/load`

Add ticker, set `india` and voila!

* updated "help"

* added check for `.ns`, `.NS` in ticker

* consolidated conditions into 1 line
  • Loading branch information
the-praxs authored Aug 4, 2023
1 parent f1eee44 commit 564d08e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions openbb_terminal/parent_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1485,6 +1485,13 @@ def call_load(self, other_args: List[str]):
default=False,
help="Show performance information.",
)
parser.add_argument(
"--india",
dest="india",
action="store_true",
default=False,
help="Only works for yf source, when the ticker has .NS suffix as part of it.",
)
if other_args and "-" not in other_args[0][0]:
other_args.insert(0, "-t")

Expand All @@ -1498,6 +1505,8 @@ def call_load(self, other_args: List[str]):
"[red]Only one of monthly or weekly can be selected.[/red]."
)
return
if ns_parser.india and not ns_parser.ticker.endswith((".ns", ".NS")):
ns_parser.ticker = ns_parser.ticker + ".NS"
if ns_parser.filepath is None:
df_stock_candidate = stocks_helper.load(
ns_parser.ticker,
Expand Down

0 comments on commit 564d08e

Please sign in to comment.