mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-29 05:21:48 +00:00
Add ETF examples (#6102)
Co-authored-by: Pratyush Shukla <ps4534@nyu.edu>
This commit is contained in:
@@ -15,7 +15,14 @@ router = Router(prefix="/discovery")
|
||||
# pylint: disable=unused-argument
|
||||
|
||||
|
||||
@router.command(model="ETFGainers", operation_id="etf_gainers")
|
||||
@router.command(
|
||||
model="ETFGainers",
|
||||
operation_id="etf_gainers",
|
||||
examples=[
|
||||
"### Get the top ETF gainers. ###",
|
||||
'obb.etf.discovery.gainers(provider="wsj")',
|
||||
],
|
||||
)
|
||||
async def gainers(
|
||||
cc: CommandContext,
|
||||
provider_choices: ProviderChoices,
|
||||
@@ -26,7 +33,14 @@ async def gainers(
|
||||
return await OBBject.from_query(Query(**locals()))
|
||||
|
||||
|
||||
@router.command(model="ETFLosers", operation_id="etf_losers")
|
||||
@router.command(
|
||||
model="ETFLosers",
|
||||
operation_id="etf_losers",
|
||||
examples=[
|
||||
"### Get the top ETF losers. ###",
|
||||
'obb.etf.discovery.losers(provider="wsj")',
|
||||
],
|
||||
)
|
||||
async def losers(
|
||||
cc: CommandContext,
|
||||
provider_choices: ProviderChoices,
|
||||
@@ -37,7 +51,14 @@ async def losers(
|
||||
return await OBBject.from_query(Query(**locals()))
|
||||
|
||||
|
||||
@router.command(model="ETFActive", operation_id="etf_active")
|
||||
@router.command(
|
||||
model="ETFActive",
|
||||
operation_id="etf_active",
|
||||
examples=[
|
||||
"### Get the most active ETFs. ###",
|
||||
'obb.etf.discovery.active(provider="wsj")',
|
||||
],
|
||||
)
|
||||
async def active(
|
||||
cc: CommandContext,
|
||||
provider_choices: ProviderChoices,
|
||||
|
||||
@@ -41,7 +41,15 @@ async def search(
|
||||
return await OBBject.from_query(Query(**locals()))
|
||||
|
||||
|
||||
@router.command(model="EtfHistorical", operation_id="etf_historical")
|
||||
@router.command(
|
||||
model="EtfHistorical",
|
||||
operation_id="etf_historical",
|
||||
examples=[
|
||||
'obb.etf.historical("SPY", provider="yfinance")',
|
||||
"#### This function accepts multiple tickers. ####",
|
||||
'obb.etf.historical("SPY,IWM,QQQ,DJIA", provider="yfinance")',
|
||||
],
|
||||
)
|
||||
async def historical(
|
||||
cc: CommandContext,
|
||||
provider_choices: ProviderChoices,
|
||||
|
||||
Reference in New Issue
Block a user