mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 13:01:38 +00:00
add --india flag to stocks/load (#5281)
* 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
This commit is contained in:
@@ -1485,6 +1485,13 @@ class StockBaseController(BaseController, metaclass=ABCMeta):
|
||||
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")
|
||||
|
||||
@@ -1498,6 +1505,8 @@ class StockBaseController(BaseController, metaclass=ABCMeta):
|
||||
"[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,
|
||||
|
||||
Reference in New Issue
Block a user