Skip to content

Commit

Permalink
moved default amount of results from DividendScanner __init__ to the …
Browse files Browse the repository at this point in the history
…calling function
  • Loading branch information
holohup committed Aug 21, 2023
1 parent 35a6f88 commit 062bf15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bot/scanner/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ async def get_api_response(instrument: str):


class DividendScanner:
def __init__(self, result_limit=50) -> None:
def __init__(self, result_limit) -> None:
self._ir = float(CURRENT_INTEREST_RATE)
self._result_limit = result_limit

Expand Down Expand Up @@ -558,11 +558,11 @@ async def _update_from_orderbooks(self, uids_to_update):
self._orderbooks.update(result)


async def dividend_scan(command, args):
async def dividend_scan(command, args='50'):
return await DividendScanner(int(args)).scan_spreads()


if __name__ == '__main__':
import asyncio

print(asyncio.run(dividend_scan(1, 50)))
print(asyncio.run(dividend_scan(1)))

0 comments on commit 062bf15

Please sign in to comment.