diff --git a/ib_async/ib.py b/ib_async/ib.py index cc9a772..9c64ad3 100644 --- a/ib_async/ib.py +++ b/ib_async/ib.py @@ -1115,7 +1115,7 @@ def reqRealTimeBars( barSize: int, whatToShow: str, useRTH: bool, - realTimeBarsOptions: list[TagValue] = [], + realTimeBarsOptions: list[TagValue] | None = None, ) -> RealTimeBarList: """ Request realtime 5 second bars. @@ -1165,7 +1165,7 @@ def reqHistoricalData( useRTH: bool, formatDate: int = 1, keepUpToDate: bool = False, - chartOptions: list[TagValue] = [], + chartOptions: list[TagValue] | None = None, timeout: float = 60, ) -> BarDataList: """ @@ -1272,7 +1272,7 @@ def reqHistoricalTicks( whatToShow: str, useRth: bool, ignoreSize: bool = False, - miscOptions: list[TagValue] = [], + miscOptions: list[TagValue] | None = None, ) -> List: """ Request historical ticks. The time resolution of the ticks @@ -1352,7 +1352,7 @@ def reqMktData( genericTickList: str = "", snapshot: bool = False, regulatorySnapshot: bool = False, - mktDataOptions: list[TagValue] = [], + mktDataOptions: list[TagValue] | None = None, ) -> Ticker: """ Subscribe to tick data or request a snapshot. @@ -1582,7 +1582,7 @@ def reqFundamentalData( self, contract: Contract, reportType: str, - fundamentalDataOptions: list[TagValue] = [], + fundamentalDataOptions: list[TagValue] | None = None, ) -> str: """ Get fundamental data of a contract in XML format. @@ -1610,8 +1610,8 @@ def reqFundamentalData( def reqScannerData( self, subscription: ScannerSubscription, - scannerSubscriptionOptions: list[TagValue] = [], - scannerSubscriptionFilterOptions: list[TagValue] = [], + scannerSubscriptionOptions: list[TagValue] | None = None, + scannerSubscriptionFilterOptions: list[TagValue] | None = None, ) -> ScanDataList: """ Do a blocking market scan by starting a subscription and canceling it @@ -1637,8 +1637,8 @@ def reqScannerData( def reqScannerSubscription( self, subscription: ScannerSubscription, - scannerSubscriptionOptions: list[TagValue] = [], - scannerSubscriptionFilterOptions: list[TagValue] = [], + scannerSubscriptionOptions: list[TagValue] | None = None, + scannerSubscriptionFilterOptions: list[TagValue] | None = None, ) -> ScanDataList: """ Subscribe to market scan data. @@ -1655,9 +1655,7 @@ def reqScannerSubscription( dataList.reqId = reqId dataList.subscription = subscription dataList.scannerSubscriptionOptions = scannerSubscriptionOptions or [] - dataList.scannerSubscriptionFilterOptions = ( - scannerSubscriptionFilterOptions or [] - ) + dataList.scannerSubscriptionFilterOptions = scannerSubscriptionFilterOptions or [] self.wrapper.startSubscription(reqId, dataList) self.client.reqScannerSubscription( reqId, @@ -1693,7 +1691,7 @@ def calculateImpliedVolatility( contract: Contract, optionPrice: float, underPrice: float, - implVolOptions: list[TagValue] = [], + implVolOptions: list[TagValue] | None = None, ) -> OptionComputation: """ Calculate the volatility given the option price. @@ -1719,7 +1717,7 @@ def calculateOptionPrice( contract: Contract, volatility: float, underPrice: float, - optPrcOptions: list[TagValue] = [], + optPrcOptions: list[TagValue] | None = None, ) -> OptionComputation: """ Calculate the option price given the volatility. @@ -1732,7 +1730,7 @@ def calculateOptionPrice( contract: Option contract. volatility: Option volatility to use in calculation. underPrice: Price of the underlier to use in calculation - implVolOptions: Unknown + optPrcOptions: TODO """ return self._run( self.calculateOptionPriceAsync( @@ -1806,7 +1804,7 @@ def reqNewsProviders(self) -> list[NewsProvider]: return self._run(self.reqNewsProvidersAsync()) def reqNewsArticle( - self, providerCode: str, articleId: str, newsArticleOptions: list[TagValue] = [] + self, providerCode: str, articleId: str, newsArticleOptions: list[TagValue] | None = None, ) -> NewsArticle: """ Get the body of a news article. @@ -1831,7 +1829,7 @@ def reqHistoricalNews( startDateTime: Union[str, datetime.date], endDateTime: Union[str, datetime.date], totalResults: int, - historicalNewsOptions: list[TagValue] = [], + historicalNewsOptions: list[TagValue] | None = None, ) -> HistoricalNews: """ Get historical news headline. @@ -2297,7 +2295,7 @@ async def reqHistoricalDataAsync( useRTH: bool, formatDate: int = 1, keepUpToDate: bool = False, - chartOptions: list[TagValue] = [], + chartOptions: list[TagValue] | None = None, timeout: float = 60, ) -> BarDataList: reqId = self.client.getReqId() @@ -2372,7 +2370,7 @@ def reqHistoricalTicksAsync( whatToShow: str, useRth: bool, ignoreSize: bool = False, - miscOptions: list[TagValue] = [], + miscOptions: list[TagValue] | None = None, ) -> Awaitable[List]: reqId = self.client.getReqId() future = self.wrapper.startReq(reqId, contract) @@ -2428,7 +2426,7 @@ def reqFundamentalDataAsync( self, contract: Contract, reportType: str, - fundamentalDataOptions: list[TagValue] = [], + fundamentalDataOptions: list[TagValue] | None = None, ) -> Awaitable[str]: reqId = self.client.getReqId() @@ -2441,8 +2439,8 @@ def reqFundamentalDataAsync( async def reqScannerDataAsync( self, subscription: ScannerSubscription, - scannerSubscriptionOptions: list[TagValue] = [], - scannerSubscriptionFilterOptions: list[TagValue] = [], + scannerSubscriptionOptions: list[TagValue] | None = None, + scannerSubscriptionFilterOptions: list[TagValue] | None = None, ) -> ScanDataList: dataList = self.reqScannerSubscription( subscription, @@ -2466,7 +2464,7 @@ async def calculateImpliedVolatilityAsync( contract: Contract, optionPrice: float, underPrice: float, - implVolOptions: list[TagValue] = [], + implVolOptions: list[TagValue] | None = None, ) -> Optional[OptionComputation]: reqId = self.client.getReqId() future = self.wrapper.startReq(reqId, contract) @@ -2487,7 +2485,7 @@ async def calculateOptionPriceAsync( contract: Contract, volatility: float, underPrice: float, - optPrcOptions: list[TagValue] = [], + optPrcOptions: list[TagValue] | None = None, ) -> Optional[OptionComputation]: reqId = self.client.getReqId() future = self.wrapper.startReq(reqId, contract) @@ -2524,7 +2522,7 @@ def reqNewsProvidersAsync(self) -> Awaitable[list[NewsProvider]]: return future def reqNewsArticleAsync( - self, providerCode: str, articleId: str, newsArticleOptions: list[TagValue] = [] + self, providerCode: str, articleId: str, newsArticleOptions: list[TagValue] | None = None ) -> Awaitable[NewsArticle]: reqId = self.client.getReqId() @@ -2539,7 +2537,7 @@ async def reqHistoricalNewsAsync( startDateTime: Union[str, datetime.date], endDateTime: Union[str, datetime.date], totalResults: int, - historicalNewsOptions: list[TagValue] = [], + historicalNewsOptions: list[TagValue] | None = None, ) -> Optional[HistoricalNews]: reqId = self.client.getReqId()