repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
erdewit/ib_insync | ib_insync/ib.py | IB.reqPnL | def reqPnL(self, account: str, modelCode: str = '') -> PnL:
"""
Start a subscription for profit and loss events.
Returns a :class:`.PnL` object that is kept live updated.
The result can also be queried from :meth:`.pnl`.
https://interactivebrokers.github.io/tws-api/pnl.html
... | python | def reqPnL(self, account: str, modelCode: str = '') -> PnL:
"""
Start a subscription for profit and loss events.
Returns a :class:`.PnL` object that is kept live updated.
The result can also be queried from :meth:`.pnl`.
https://interactivebrokers.github.io/tws-api/pnl.html
... | [
"def",
"reqPnL",
"(",
"self",
",",
"account",
":",
"str",
",",
"modelCode",
":",
"str",
"=",
"''",
")",
"->",
"PnL",
":",
"key",
"=",
"(",
"account",
",",
"modelCode",
")",
"assert",
"key",
"not",
"in",
"self",
".",
"wrapper",
".",
"pnlKey2ReqId",
... | Start a subscription for profit and loss events.
Returns a :class:`.PnL` object that is kept live updated.
The result can also be queried from :meth:`.pnl`.
https://interactivebrokers.github.io/tws-api/pnl.html
Args:
account: Subscribe to this account.
modelCod... | [
"Start",
"a",
"subscription",
"for",
"profit",
"and",
"loss",
"events",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L793-L813 | train | Subscribe to this account and modelCode and return a new PnL object that is kept live updated. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.cancelPnL | def cancelPnL(self, account, modelCode: str = ''):
"""
Cancel PnL subscription.
Args:
account: Cancel for this account.
modelCode: If specified, cancel for this account model.
"""
key = (account, modelCode)
reqId = self.wrapper.pnlKey2ReqId.pop(ke... | python | def cancelPnL(self, account, modelCode: str = ''):
"""
Cancel PnL subscription.
Args:
account: Cancel for this account.
modelCode: If specified, cancel for this account model.
"""
key = (account, modelCode)
reqId = self.wrapper.pnlKey2ReqId.pop(ke... | [
"def",
"cancelPnL",
"(",
"self",
",",
"account",
",",
"modelCode",
":",
"str",
"=",
"''",
")",
":",
"key",
"=",
"(",
"account",
",",
"modelCode",
")",
"reqId",
"=",
"self",
".",
"wrapper",
".",
"pnlKey2ReqId",
".",
"pop",
"(",
"key",
",",
"None",
"... | Cancel PnL subscription.
Args:
account: Cancel for this account.
modelCode: If specified, cancel for this account model. | [
"Cancel",
"PnL",
"subscription",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L815-L831 | train | Cancel PnL subscription for the specified account and model code. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqPnLSingle | def reqPnLSingle(
self, account: str, modelCode: str, conId: int) -> PnLSingle:
"""
Start a subscription for profit and loss events for single positions.
Returns a :class:`.PnLSingle` object that is kept live updated.
The result can also be queried from :meth:`.pnlSingle`.
... | python | def reqPnLSingle(
self, account: str, modelCode: str, conId: int) -> PnLSingle:
"""
Start a subscription for profit and loss events for single positions.
Returns a :class:`.PnLSingle` object that is kept live updated.
The result can also be queried from :meth:`.pnlSingle`.
... | [
"def",
"reqPnLSingle",
"(",
"self",
",",
"account",
":",
"str",
",",
"modelCode",
":",
"str",
",",
"conId",
":",
"int",
")",
"->",
"PnLSingle",
":",
"key",
"=",
"(",
"account",
",",
"modelCode",
",",
"conId",
")",
"assert",
"key",
"not",
"in",
"self"... | Start a subscription for profit and loss events for single positions.
Returns a :class:`.PnLSingle` object that is kept live updated.
The result can also be queried from :meth:`.pnlSingle`.
https://interactivebrokers.github.io/tws-api/pnl.html
Args:
account: Subscribe to t... | [
"Start",
"a",
"subscription",
"for",
"profit",
"and",
"loss",
"events",
"for",
"single",
"positions",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L833-L855 | train | Subscribe to this account modelCode and contract ID and request a profit and loss event for single positions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.cancelPnLSingle | def cancelPnLSingle(
self, account: str, modelCode: str, conId: int):
"""
Cancel PnLSingle subscription for the given account, modelCode
and conId.
Args:
account: Cancel for this account name.
modelCode: Cancel for this account model.
conI... | python | def cancelPnLSingle(
self, account: str, modelCode: str, conId: int):
"""
Cancel PnLSingle subscription for the given account, modelCode
and conId.
Args:
account: Cancel for this account name.
modelCode: Cancel for this account model.
conI... | [
"def",
"cancelPnLSingle",
"(",
"self",
",",
"account",
":",
"str",
",",
"modelCode",
":",
"str",
",",
"conId",
":",
"int",
")",
":",
"key",
"=",
"(",
"account",
",",
"modelCode",
",",
"conId",
")",
"reqId",
"=",
"self",
".",
"wrapper",
".",
"pnlSingl... | Cancel PnLSingle subscription for the given account, modelCode
and conId.
Args:
account: Cancel for this account name.
modelCode: Cancel for this account model.
conId: Cancel for this contract ID. | [
"Cancel",
"PnLSingle",
"subscription",
"for",
"the",
"given",
"account",
"modelCode",
"and",
"conId",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L857-L876 | train | Cancel a PnLSingle subscription for the given account modelCode and conId. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqContractDetails | def reqContractDetails(self, contract: Contract) -> List[ContractDetails]:
"""
Get a list of contract details that match the given contract.
If the returned list is empty then the contract is not known;
If the list has multiple values then the contract is ambiguous.
The fully qu... | python | def reqContractDetails(self, contract: Contract) -> List[ContractDetails]:
"""
Get a list of contract details that match the given contract.
If the returned list is empty then the contract is not known;
If the list has multiple values then the contract is ambiguous.
The fully qu... | [
"def",
"reqContractDetails",
"(",
"self",
",",
"contract",
":",
"Contract",
")",
"->",
"List",
"[",
"ContractDetails",
"]",
":",
"return",
"self",
".",
"_run",
"(",
"self",
".",
"reqContractDetailsAsync",
"(",
"contract",
")",
")"
] | Get a list of contract details that match the given contract.
If the returned list is empty then the contract is not known;
If the list has multiple values then the contract is ambiguous.
The fully qualified contract is available in the the
ContractDetails.contract attribute.
T... | [
"Get",
"a",
"list",
"of",
"contract",
"details",
"that",
"match",
"the",
"given",
"contract",
".",
"If",
"the",
"returned",
"list",
"is",
"empty",
"then",
"the",
"contract",
"is",
"not",
"known",
";",
"If",
"the",
"list",
"has",
"multiple",
"values",
"th... | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L878-L894 | train | Get a list of contract details that match the given contract. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqMatchingSymbols | def reqMatchingSymbols(self, pattern: str) -> List[ContractDescription]:
"""
Request contract descriptions of contracts that match a pattern.
This method is blocking.
https://interactivebrokers.github.io/tws-api/matching_symbols.html
Args:
pattern: The first few le... | python | def reqMatchingSymbols(self, pattern: str) -> List[ContractDescription]:
"""
Request contract descriptions of contracts that match a pattern.
This method is blocking.
https://interactivebrokers.github.io/tws-api/matching_symbols.html
Args:
pattern: The first few le... | [
"def",
"reqMatchingSymbols",
"(",
"self",
",",
"pattern",
":",
"str",
")",
"->",
"List",
"[",
"ContractDescription",
"]",
":",
"return",
"self",
".",
"_run",
"(",
"self",
".",
"reqMatchingSymbolsAsync",
"(",
"pattern",
")",
")"
] | Request contract descriptions of contracts that match a pattern.
This method is blocking.
https://interactivebrokers.github.io/tws-api/matching_symbols.html
Args:
pattern: The first few letters of the ticker symbol, or for
longer strings a character sequence matchi... | [
"Request",
"contract",
"descriptions",
"of",
"contracts",
"that",
"match",
"a",
"pattern",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L896-L909 | train | Request contracts that match a pattern. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqMarketRule | def reqMarketRule(self, marketRuleId: int) -> PriceIncrement:
"""
Request price increments rule.
https://interactivebrokers.github.io/tws-api/minimum_increment.html
Args:
marketRuleId: ID of market rule.
The market rule IDs for a contract can be obtained
... | python | def reqMarketRule(self, marketRuleId: int) -> PriceIncrement:
"""
Request price increments rule.
https://interactivebrokers.github.io/tws-api/minimum_increment.html
Args:
marketRuleId: ID of market rule.
The market rule IDs for a contract can be obtained
... | [
"def",
"reqMarketRule",
"(",
"self",
",",
"marketRuleId",
":",
"int",
")",
"->",
"PriceIncrement",
":",
"return",
"self",
".",
"_run",
"(",
"self",
".",
"reqMarketRuleAsync",
"(",
"marketRuleId",
")",
")"
] | Request price increments rule.
https://interactivebrokers.github.io/tws-api/minimum_increment.html
Args:
marketRuleId: ID of market rule.
The market rule IDs for a contract can be obtained
via :meth:`.reqContractDetails` from
:class:`.Contrac... | [
"Request",
"price",
"increments",
"rule",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L911-L924 | train | Request price increments rule. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqRealTimeBars | def reqRealTimeBars(
self, contract: Contract, barSize: int,
whatToShow: str, useRTH: bool,
realTimeBarsOptions: List[TagValue] = None) -> RealTimeBarList:
"""
Request realtime 5 second bars.
https://interactivebrokers.github.io/tws-api/realtime_bars.html
... | python | def reqRealTimeBars(
self, contract: Contract, barSize: int,
whatToShow: str, useRTH: bool,
realTimeBarsOptions: List[TagValue] = None) -> RealTimeBarList:
"""
Request realtime 5 second bars.
https://interactivebrokers.github.io/tws-api/realtime_bars.html
... | [
"def",
"reqRealTimeBars",
"(",
"self",
",",
"contract",
":",
"Contract",
",",
"barSize",
":",
"int",
",",
"whatToShow",
":",
"str",
",",
"useRTH",
":",
"bool",
",",
"realTimeBarsOptions",
":",
"List",
"[",
"TagValue",
"]",
"=",
"None",
")",
"->",
"RealTi... | Request realtime 5 second bars.
https://interactivebrokers.github.io/tws-api/realtime_bars.html
Args:
contract: Contract of interest.
barSize: Must be 5.
whatToShow: Specifies the source for constructing bars.
Can be 'TRADES', 'MIDPOINT', 'BID' or 'A... | [
"Request",
"realtime",
"5",
"second",
"bars",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L926-L955 | train | Request realtime 5 second bars. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.cancelRealTimeBars | def cancelRealTimeBars(self, bars: RealTimeBarList):
"""
Cancel the realtime bars subscription.
Args:
bars: The bar list that was obtained from ``reqRealTimeBars``.
"""
self.client.cancelRealTimeBars(bars.reqId)
self.wrapper.endSubscription(bars) | python | def cancelRealTimeBars(self, bars: RealTimeBarList):
"""
Cancel the realtime bars subscription.
Args:
bars: The bar list that was obtained from ``reqRealTimeBars``.
"""
self.client.cancelRealTimeBars(bars.reqId)
self.wrapper.endSubscription(bars) | [
"def",
"cancelRealTimeBars",
"(",
"self",
",",
"bars",
":",
"RealTimeBarList",
")",
":",
"self",
".",
"client",
".",
"cancelRealTimeBars",
"(",
"bars",
".",
"reqId",
")",
"self",
".",
"wrapper",
".",
"endSubscription",
"(",
"bars",
")"
] | Cancel the realtime bars subscription.
Args:
bars: The bar list that was obtained from ``reqRealTimeBars``. | [
"Cancel",
"the",
"realtime",
"bars",
"subscription",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L957-L965 | train | Cancels the realtime bars subscription. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqHistoricalData | def reqHistoricalData(
self, contract: Contract, endDateTime: object,
durationStr: str, barSizeSetting: str,
whatToShow: str, useRTH: bool,
formatDate: int = 1, keepUpToDate: bool = False,
chartOptions: List[TagValue] = None) -> BarDataList:
"""
... | python | def reqHistoricalData(
self, contract: Contract, endDateTime: object,
durationStr: str, barSizeSetting: str,
whatToShow: str, useRTH: bool,
formatDate: int = 1, keepUpToDate: bool = False,
chartOptions: List[TagValue] = None) -> BarDataList:
"""
... | [
"def",
"reqHistoricalData",
"(",
"self",
",",
"contract",
":",
"Contract",
",",
"endDateTime",
":",
"object",
",",
"durationStr",
":",
"str",
",",
"barSizeSetting",
":",
"str",
",",
"whatToShow",
":",
"str",
",",
"useRTH",
":",
"bool",
",",
"formatDate",
"... | Request historical bar data.
This method is blocking.
https://interactivebrokers.github.io/tws-api/historical_bars.html
Args:
contract: Contract of interest.
endDateTime: Can be set to '' to indicate the current time,
or it can be given as a datetime.da... | [
"Request",
"historical",
"bar",
"data",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L967-L1014 | train | Request historical data from Regular
. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.cancelHistoricalData | def cancelHistoricalData(self, bars: BarDataList):
"""
Cancel the update subscription for the historical bars.
Args:
bars: The bar list that was obtained from ``reqHistoricalData``
with a keepUpToDate subscription.
"""
self.client.cancelHistoricalDat... | python | def cancelHistoricalData(self, bars: BarDataList):
"""
Cancel the update subscription for the historical bars.
Args:
bars: The bar list that was obtained from ``reqHistoricalData``
with a keepUpToDate subscription.
"""
self.client.cancelHistoricalDat... | [
"def",
"cancelHistoricalData",
"(",
"self",
",",
"bars",
":",
"BarDataList",
")",
":",
"self",
".",
"client",
".",
"cancelHistoricalData",
"(",
"bars",
".",
"reqId",
")",
"self",
".",
"wrapper",
".",
"endSubscription",
"(",
"bars",
")"
] | Cancel the update subscription for the historical bars.
Args:
bars: The bar list that was obtained from ``reqHistoricalData``
with a keepUpToDate subscription. | [
"Cancel",
"the",
"update",
"subscription",
"for",
"the",
"historical",
"bars",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1016-L1026 | train | Cancel the update subscription for the historical bars. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqHistoricalTicks | def reqHistoricalTicks(
self, contract: Contract,
startDateTime: Union[str, datetime.date],
endDateTime: Union[str, datetime.date],
numberOfTicks: int, whatToShow: str, useRth: bool,
ignoreSize: bool = False,
miscOptions: List[TagValue] = None) -> ... | python | def reqHistoricalTicks(
self, contract: Contract,
startDateTime: Union[str, datetime.date],
endDateTime: Union[str, datetime.date],
numberOfTicks: int, whatToShow: str, useRth: bool,
ignoreSize: bool = False,
miscOptions: List[TagValue] = None) -> ... | [
"def",
"reqHistoricalTicks",
"(",
"self",
",",
"contract",
":",
"Contract",
",",
"startDateTime",
":",
"Union",
"[",
"str",
",",
"datetime",
".",
"date",
"]",
",",
"endDateTime",
":",
"Union",
"[",
"str",
",",
"datetime",
".",
"date",
"]",
",",
"numberOf... | Request historical ticks. The time resolution of the ticks
is one second.
This method is blocking.
https://interactivebrokers.github.io/tws-api/historical_time_and_sales.html
Args:
contract: Contract to query.
startDateTime: Can be given as a datetime.date or
... | [
"Request",
"historical",
"ticks",
".",
"The",
"time",
"resolution",
"of",
"the",
"ticks",
"is",
"one",
"second",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1028-L1063 | train | Request historical ticks from Regular
. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqHeadTimeStamp | def reqHeadTimeStamp(
self, contract: Contract, whatToShow: str,
useRTH: bool, formatDate: int = 1) -> datetime.datetime:
"""
Get the datetime of earliest available historical data
for the contract.
Args:
contract: Contract of interest.
us... | python | def reqHeadTimeStamp(
self, contract: Contract, whatToShow: str,
useRTH: bool, formatDate: int = 1) -> datetime.datetime:
"""
Get the datetime of earliest available historical data
for the contract.
Args:
contract: Contract of interest.
us... | [
"def",
"reqHeadTimeStamp",
"(",
"self",
",",
"contract",
":",
"Contract",
",",
"whatToShow",
":",
"str",
",",
"useRTH",
":",
"bool",
",",
"formatDate",
":",
"int",
"=",
"1",
")",
"->",
"datetime",
".",
"datetime",
":",
"return",
"self",
".",
"_run",
"(... | Get the datetime of earliest available historical data
for the contract.
Args:
contract: Contract of interest.
useRTH: If True then only show data from within Regular
Trading Hours, if False then show all data.
formatDate: If set to 2 then the result ... | [
"Get",
"the",
"datetime",
"of",
"earliest",
"available",
"historical",
"data",
"for",
"the",
"contract",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1081-L1097 | train | Get the datetime of earliest available historical data for the contract. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqMktData | def reqMktData(
self, contract: Contract, genericTickList: str = '',
snapshot: bool = False, regulatorySnapshot: bool = False,
mktDataOptions: List[TagValue] = None) -> Ticker:
"""
Subscribe to tick data or request a snapshot.
Returns the Ticker that holds the... | python | def reqMktData(
self, contract: Contract, genericTickList: str = '',
snapshot: bool = False, regulatorySnapshot: bool = False,
mktDataOptions: List[TagValue] = None) -> Ticker:
"""
Subscribe to tick data or request a snapshot.
Returns the Ticker that holds the... | [
"def",
"reqMktData",
"(",
"self",
",",
"contract",
":",
"Contract",
",",
"genericTickList",
":",
"str",
"=",
"''",
",",
"snapshot",
":",
"bool",
"=",
"False",
",",
"regulatorySnapshot",
":",
"bool",
"=",
"False",
",",
"mktDataOptions",
":",
"List",
"[",
... | Subscribe to tick data or request a snapshot.
Returns the Ticker that holds the market data. The ticker will
initially be empty and gradually (after a couple of seconds)
be filled.
https://interactivebrokers.github.io/tws-api/md_request.html
Args:
contract: Contract... | [
"Subscribe",
"to",
"tick",
"data",
"or",
"request",
"a",
"snapshot",
".",
"Returns",
"the",
"Ticker",
"that",
"holds",
"the",
"market",
"data",
".",
"The",
"ticker",
"will",
"initially",
"be",
"empty",
"and",
"gradually",
"(",
"after",
"a",
"couple",
"of",... | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1099-L1154 | train | Subscribe to tick data or request a snapshot. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.cancelMktData | def cancelMktData(self, contract: Contract):
"""
Unsubscribe from realtime streaming tick data.
Args:
contract: The exact contract object that was used to
subscribe with.
"""
ticker = self.ticker(contract)
reqId = self.wrapper.endTicker(ticker... | python | def cancelMktData(self, contract: Contract):
"""
Unsubscribe from realtime streaming tick data.
Args:
contract: The exact contract object that was used to
subscribe with.
"""
ticker = self.ticker(contract)
reqId = self.wrapper.endTicker(ticker... | [
"def",
"cancelMktData",
"(",
"self",
",",
"contract",
":",
"Contract",
")",
":",
"ticker",
"=",
"self",
".",
"ticker",
"(",
"contract",
")",
"reqId",
"=",
"self",
".",
"wrapper",
".",
"endTicker",
"(",
"ticker",
",",
"'mktData'",
")",
"if",
"reqId",
":... | Unsubscribe from realtime streaming tick data.
Args:
contract: The exact contract object that was used to
subscribe with. | [
"Unsubscribe",
"from",
"realtime",
"streaming",
"tick",
"data",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1156-L1170 | train | Unsubscribe from realtime streaming tick data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqTickByTickData | def reqTickByTickData(
self, contract: Contract, tickType: str,
numberOfTicks: int = 0, ignoreSize: bool = False) -> Ticker:
"""
Subscribe to tick-by-tick data and return the Ticker that
holds the ticks in ticker.tickByTicks.
https://interactivebrokers.github.io/... | python | def reqTickByTickData(
self, contract: Contract, tickType: str,
numberOfTicks: int = 0, ignoreSize: bool = False) -> Ticker:
"""
Subscribe to tick-by-tick data and return the Ticker that
holds the ticks in ticker.tickByTicks.
https://interactivebrokers.github.io/... | [
"def",
"reqTickByTickData",
"(",
"self",
",",
"contract",
":",
"Contract",
",",
"tickType",
":",
"str",
",",
"numberOfTicks",
":",
"int",
"=",
"0",
",",
"ignoreSize",
":",
"bool",
"=",
"False",
")",
"->",
"Ticker",
":",
"reqId",
"=",
"self",
".",
"clie... | Subscribe to tick-by-tick data and return the Ticker that
holds the ticks in ticker.tickByTicks.
https://interactivebrokers.github.io/tws-api/tick_data.html
Args:
contract: Contract of interest.
tickType: One of 'Last', 'AllLast', 'BidAsk' or 'MidPoint'.
nu... | [
"Subscribe",
"to",
"tick",
"-",
"by",
"-",
"tick",
"data",
"and",
"return",
"the",
"Ticker",
"that",
"holds",
"the",
"ticks",
"in",
"ticker",
".",
"tickByTicks",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1172-L1191 | train | Subscribe to tick - by - tick data and return the Ticker that holds the ticks in ticker. tickByTicks. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.cancelTickByTickData | def cancelTickByTickData(self, contract: Contract, tickType: str):
"""
Unsubscribe from tick-by-tick data
Args:
contract: The exact contract object that was used to
subscribe with.
"""
ticker = self.ticker(contract)
reqId = self.wrapper.endTic... | python | def cancelTickByTickData(self, contract: Contract, tickType: str):
"""
Unsubscribe from tick-by-tick data
Args:
contract: The exact contract object that was used to
subscribe with.
"""
ticker = self.ticker(contract)
reqId = self.wrapper.endTic... | [
"def",
"cancelTickByTickData",
"(",
"self",
",",
"contract",
":",
"Contract",
",",
"tickType",
":",
"str",
")",
":",
"ticker",
"=",
"self",
".",
"ticker",
"(",
"contract",
")",
"reqId",
"=",
"self",
".",
"wrapper",
".",
"endTicker",
"(",
"ticker",
",",
... | Unsubscribe from tick-by-tick data
Args:
contract: The exact contract object that was used to
subscribe with. | [
"Unsubscribe",
"from",
"tick",
"-",
"by",
"-",
"tick",
"data"
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1193-L1207 | train | Unsubscribe from tick - by - tick data | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqMktDepth | def reqMktDepth(
self, contract: Contract, numRows: int = 5,
isSmartDepth: bool = False, mktDepthOptions=None) -> Ticker:
"""
Subscribe to market depth data (a.k.a. DOM, L2 or order book).
https://interactivebrokers.github.io/tws-api/market_depth.html
Args:
... | python | def reqMktDepth(
self, contract: Contract, numRows: int = 5,
isSmartDepth: bool = False, mktDepthOptions=None) -> Ticker:
"""
Subscribe to market depth data (a.k.a. DOM, L2 or order book).
https://interactivebrokers.github.io/tws-api/market_depth.html
Args:
... | [
"def",
"reqMktDepth",
"(",
"self",
",",
"contract",
":",
"Contract",
",",
"numRows",
":",
"int",
"=",
"5",
",",
"isSmartDepth",
":",
"bool",
"=",
"False",
",",
"mktDepthOptions",
"=",
"None",
")",
"->",
"Ticker",
":",
"reqId",
"=",
"self",
".",
"client... | Subscribe to market depth data (a.k.a. DOM, L2 or order book).
https://interactivebrokers.github.io/tws-api/market_depth.html
Args:
contract: Contract of interest.
numRows: Number of depth level on each side of the order book
(5 max).
isSmartDepth: C... | [
"Subscribe",
"to",
"market",
"depth",
"data",
"(",
"a",
".",
"k",
".",
"a",
".",
"DOM",
"L2",
"or",
"order",
"book",
")",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1216-L1240 | train | Subscribe to market depth data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.cancelMktDepth | def cancelMktDepth(self, contract: Contract, isSmartDepth=False):
"""
Unsubscribe from market depth data.
Args:
contract: The exact contract object that was used to
subscribe with.
"""
ticker = self.ticker(contract)
reqId = self.wrapper.endTic... | python | def cancelMktDepth(self, contract: Contract, isSmartDepth=False):
"""
Unsubscribe from market depth data.
Args:
contract: The exact contract object that was used to
subscribe with.
"""
ticker = self.ticker(contract)
reqId = self.wrapper.endTic... | [
"def",
"cancelMktDepth",
"(",
"self",
",",
"contract",
":",
"Contract",
",",
"isSmartDepth",
"=",
"False",
")",
":",
"ticker",
"=",
"self",
".",
"ticker",
"(",
"contract",
")",
"reqId",
"=",
"self",
".",
"wrapper",
".",
"endTicker",
"(",
"ticker",
",",
... | Unsubscribe from market depth data.
Args:
contract: The exact contract object that was used to
subscribe with. | [
"Unsubscribe",
"from",
"market",
"depth",
"data",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1242-L1256 | train | Cancels market depth data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqHistogramData | def reqHistogramData(
self, contract: Contract,
useRTH: bool, period: str) -> List[HistogramData]:
"""
Request histogram data.
This method is blocking.
https://interactivebrokers.github.io/tws-api/histograms.html
Args:
contract: Contract to ... | python | def reqHistogramData(
self, contract: Contract,
useRTH: bool, period: str) -> List[HistogramData]:
"""
Request histogram data.
This method is blocking.
https://interactivebrokers.github.io/tws-api/histograms.html
Args:
contract: Contract to ... | [
"def",
"reqHistogramData",
"(",
"self",
",",
"contract",
":",
"Contract",
",",
"useRTH",
":",
"bool",
",",
"period",
":",
"str",
")",
"->",
"List",
"[",
"HistogramData",
"]",
":",
"return",
"self",
".",
"_run",
"(",
"self",
".",
"reqHistogramDataAsync",
... | Request histogram data.
This method is blocking.
https://interactivebrokers.github.io/tws-api/histograms.html
Args:
contract: Contract to query.
useRTH: If True then only show data from within Regular
Trading Hours, if False then show all data.
... | [
"Request",
"histogram",
"data",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1258-L1276 | train | Request histogram data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqFundamentalData | def reqFundamentalData(
self, contract: Contract, reportType: str,
fundamentalDataOptions: List[TagValue] = None) -> str:
"""
Get fundamental data of a contract in XML format.
This method is blocking.
https://interactivebrokers.github.io/tws-api/fundamentals.htm... | python | def reqFundamentalData(
self, contract: Contract, reportType: str,
fundamentalDataOptions: List[TagValue] = None) -> str:
"""
Get fundamental data of a contract in XML format.
This method is blocking.
https://interactivebrokers.github.io/tws-api/fundamentals.htm... | [
"def",
"reqFundamentalData",
"(",
"self",
",",
"contract",
":",
"Contract",
",",
"reportType",
":",
"str",
",",
"fundamentalDataOptions",
":",
"List",
"[",
"TagValue",
"]",
"=",
"None",
")",
"->",
"str",
":",
"return",
"self",
".",
"_run",
"(",
"self",
"... | Get fundamental data of a contract in XML format.
This method is blocking.
https://interactivebrokers.github.io/tws-api/fundamentals.html
Args:
contract: Contract to query.
reportType:
* 'ReportsFinSummary': Financial summary
* 'Reports... | [
"Get",
"fundamental",
"data",
"of",
"a",
"contract",
"in",
"XML",
"format",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1278-L1302 | train | Request fundamental data of a specific object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqScannerData | def reqScannerData(
self, subscription: ScannerSubscription,
scannerSubscriptionOptions: List[TagValue] = None,
scannerSubscriptionFilterOptions:
List[TagValue] = None) -> ScanDataList:
"""
Do a blocking market scan by starting a subscription and canceling... | python | def reqScannerData(
self, subscription: ScannerSubscription,
scannerSubscriptionOptions: List[TagValue] = None,
scannerSubscriptionFilterOptions:
List[TagValue] = None) -> ScanDataList:
"""
Do a blocking market scan by starting a subscription and canceling... | [
"def",
"reqScannerData",
"(",
"self",
",",
"subscription",
":",
"ScannerSubscription",
",",
"scannerSubscriptionOptions",
":",
"List",
"[",
"TagValue",
"]",
"=",
"None",
",",
"scannerSubscriptionFilterOptions",
":",
"List",
"[",
"TagValue",
"]",
"=",
"None",
")",
... | Do a blocking market scan by starting a subscription and canceling it
after the initial list of results are in.
This method is blocking.
https://interactivebrokers.github.io/tws-api/market_scanners.html
Args:
subscription: Basic filters.
scannerSubscriptionOpti... | [
"Do",
"a",
"blocking",
"market",
"scan",
"by",
"starting",
"a",
"subscription",
"and",
"canceling",
"it",
"after",
"the",
"initial",
"list",
"of",
"results",
"are",
"in",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1304-L1325 | train | Request the list of results from a scan. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqScannerSubscription | def reqScannerSubscription(
self, subscription: ScannerSubscription,
scannerSubscriptionOptions: List[TagValue] = None,
scannerSubscriptionFilterOptions:
List[TagValue] = None) -> ScanDataList:
"""
Subscribe to market scan data.
https://interactiv... | python | def reqScannerSubscription(
self, subscription: ScannerSubscription,
scannerSubscriptionOptions: List[TagValue] = None,
scannerSubscriptionFilterOptions:
List[TagValue] = None) -> ScanDataList:
"""
Subscribe to market scan data.
https://interactiv... | [
"def",
"reqScannerSubscription",
"(",
"self",
",",
"subscription",
":",
"ScannerSubscription",
",",
"scannerSubscriptionOptions",
":",
"List",
"[",
"TagValue",
"]",
"=",
"None",
",",
"scannerSubscriptionFilterOptions",
":",
"List",
"[",
"TagValue",
"]",
"=",
"None",... | Subscribe to market scan data.
https://interactivebrokers.github.io/tws-api/market_scanners.html
Args:
subscription: What to scan for.
scannerSubscriptionOptions: Unknown.
scannerSubscriptionFilterOptions: Unknown. | [
"Subscribe",
"to",
"market",
"scan",
"data",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1327-L1353 | train | Subscribe to market scan data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.cancelScannerSubscription | def cancelScannerSubscription(self, dataList: ScanDataList):
"""
Cancel market data subscription.
https://interactivebrokers.github.io/tws-api/market_scanners.html
Args:
dataList: The scan data list that was obtained from
:meth:`.reqScannerSubscription`.
... | python | def cancelScannerSubscription(self, dataList: ScanDataList):
"""
Cancel market data subscription.
https://interactivebrokers.github.io/tws-api/market_scanners.html
Args:
dataList: The scan data list that was obtained from
:meth:`.reqScannerSubscription`.
... | [
"def",
"cancelScannerSubscription",
"(",
"self",
",",
"dataList",
":",
"ScanDataList",
")",
":",
"self",
".",
"client",
".",
"cancelScannerSubscription",
"(",
"dataList",
".",
"reqId",
")",
"self",
".",
"wrapper",
".",
"endSubscription",
"(",
"dataList",
")"
] | Cancel market data subscription.
https://interactivebrokers.github.io/tws-api/market_scanners.html
Args:
dataList: The scan data list that was obtained from
:meth:`.reqScannerSubscription`. | [
"Cancel",
"market",
"data",
"subscription",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1355-L1366 | train | Cancel market data subscription. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.calculateImpliedVolatility | def calculateImpliedVolatility(
self, contract: Contract,
optionPrice: float, underPrice: float,
implVolOptions: List[TagValue] = None) -> OptionComputation:
"""
Calculate the volatility given the option price.
This method is blocking.
https://intera... | python | def calculateImpliedVolatility(
self, contract: Contract,
optionPrice: float, underPrice: float,
implVolOptions: List[TagValue] = None) -> OptionComputation:
"""
Calculate the volatility given the option price.
This method is blocking.
https://intera... | [
"def",
"calculateImpliedVolatility",
"(",
"self",
",",
"contract",
":",
"Contract",
",",
"optionPrice",
":",
"float",
",",
"underPrice",
":",
"float",
",",
"implVolOptions",
":",
"List",
"[",
"TagValue",
"]",
"=",
"None",
")",
"->",
"OptionComputation",
":",
... | Calculate the volatility given the option price.
This method is blocking.
https://interactivebrokers.github.io/tws-api/option_computations.html
Args:
contract: Option contract.
optionPrice: Option price to use in calculation.
underPrice: Price of the underl... | [
"Calculate",
"the",
"volatility",
"given",
"the",
"option",
"price",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1376-L1395 | train | Calculate the volatility given the option price and underlier price. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.calculateOptionPrice | def calculateOptionPrice(
self, contract: Contract,
volatility: float, underPrice: float,
optPrcOptions=None) -> OptionComputation:
"""
Calculate the option price given the volatility.
This method is blocking.
https://interactivebrokers.github.io/tws... | python | def calculateOptionPrice(
self, contract: Contract,
volatility: float, underPrice: float,
optPrcOptions=None) -> OptionComputation:
"""
Calculate the option price given the volatility.
This method is blocking.
https://interactivebrokers.github.io/tws... | [
"def",
"calculateOptionPrice",
"(",
"self",
",",
"contract",
":",
"Contract",
",",
"volatility",
":",
"float",
",",
"underPrice",
":",
"float",
",",
"optPrcOptions",
"=",
"None",
")",
"->",
"OptionComputation",
":",
"return",
"self",
".",
"_run",
"(",
"self"... | Calculate the option price given the volatility.
This method is blocking.
https://interactivebrokers.github.io/tws-api/option_computations.html
Args:
contract: Option contract.
volatility: Option volatility to use in calculation.
underPrice: Price of the un... | [
"Calculate",
"the",
"option",
"price",
"given",
"the",
"volatility",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1397-L1416 | train | Calculate the option price given the volatility. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqSecDefOptParams | def reqSecDefOptParams(
self, underlyingSymbol: str,
futFopExchange: str, underlyingSecType: str,
underlyingConId: int) -> List[OptionChain]:
"""
Get the option chain.
This method is blocking.
https://interactivebrokers.github.io/tws-api/options.html... | python | def reqSecDefOptParams(
self, underlyingSymbol: str,
futFopExchange: str, underlyingSecType: str,
underlyingConId: int) -> List[OptionChain]:
"""
Get the option chain.
This method is blocking.
https://interactivebrokers.github.io/tws-api/options.html... | [
"def",
"reqSecDefOptParams",
"(",
"self",
",",
"underlyingSymbol",
":",
"str",
",",
"futFopExchange",
":",
"str",
",",
"underlyingSecType",
":",
"str",
",",
"underlyingConId",
":",
"int",
")",
"->",
"List",
"[",
"OptionChain",
"]",
":",
"return",
"self",
"."... | Get the option chain.
This method is blocking.
https://interactivebrokers.github.io/tws-api/options.html
Args:
underlyingSymbol: Symbol of underlier contract.
futFopExchange: Exchange (only for ``FuturesOption``, otherwise
leave blank).
unde... | [
"Get",
"the",
"option",
"chain",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1418-L1440 | train | Request the option chain parameters for the underlying security. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.exerciseOptions | def exerciseOptions(
self, contract: Contract, exerciseAction: int,
exerciseQuantity: int, account: str, override: int):
"""
Exercise an options contract.
https://interactivebrokers.github.io/tws-api/options.html
Args:
contract: The option contract t... | python | def exerciseOptions(
self, contract: Contract, exerciseAction: int,
exerciseQuantity: int, account: str, override: int):
"""
Exercise an options contract.
https://interactivebrokers.github.io/tws-api/options.html
Args:
contract: The option contract t... | [
"def",
"exerciseOptions",
"(",
"self",
",",
"contract",
":",
"Contract",
",",
"exerciseAction",
":",
"int",
",",
"exerciseQuantity",
":",
"int",
",",
"account",
":",
"str",
",",
"override",
":",
"int",
")",
":",
"reqId",
"=",
"self",
".",
"client",
".",
... | Exercise an options contract.
https://interactivebrokers.github.io/tws-api/options.html
Args:
contract: The option contract to be exercised.
exerciseAction:
* 1 = exercise the option
* 2 = let the option lapse
exerciseQuantity: Number... | [
"Exercise",
"an",
"options",
"contract",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1442-L1464 | train | Exercise an options contract. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqNewsArticle | def reqNewsArticle(
self, providerCode: str, articleId: str,
newsArticleOptions: List[TagValue] = None) -> NewsArticle:
"""
Get the body of a news article.
This method is blocking.
https://interactivebrokers.github.io/tws-api/news.html
Args:
... | python | def reqNewsArticle(
self, providerCode: str, articleId: str,
newsArticleOptions: List[TagValue] = None) -> NewsArticle:
"""
Get the body of a news article.
This method is blocking.
https://interactivebrokers.github.io/tws-api/news.html
Args:
... | [
"def",
"reqNewsArticle",
"(",
"self",
",",
"providerCode",
":",
"str",
",",
"articleId",
":",
"str",
",",
"newsArticleOptions",
":",
"List",
"[",
"TagValue",
"]",
"=",
"None",
")",
"->",
"NewsArticle",
":",
"return",
"self",
".",
"_run",
"(",
"self",
"."... | Get the body of a news article.
This method is blocking.
https://interactivebrokers.github.io/tws-api/news.html
Args:
providerCode: Code indicating news provider, like 'BZ' or 'FLY'.
articleId: ID of the specific article.
newsArticleOptions: Unknown. | [
"Get",
"the",
"body",
"of",
"a",
"news",
"article",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1474-L1491 | train | Request a specific news article. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.reqHistoricalNews | def reqHistoricalNews(
self, conId: int, providerCodes: str,
startDateTime: Union[str, datetime.date],
endDateTime: Union[str, datetime.date],
totalResults: int,
historicalNewsOptions: List[TagValue] = None) -> HistoricalNews:
"""
Get historica... | python | def reqHistoricalNews(
self, conId: int, providerCodes: str,
startDateTime: Union[str, datetime.date],
endDateTime: Union[str, datetime.date],
totalResults: int,
historicalNewsOptions: List[TagValue] = None) -> HistoricalNews:
"""
Get historica... | [
"def",
"reqHistoricalNews",
"(",
"self",
",",
"conId",
":",
"int",
",",
"providerCodes",
":",
"str",
",",
"startDateTime",
":",
"Union",
"[",
"str",
",",
"datetime",
".",
"date",
"]",
",",
"endDateTime",
":",
"Union",
"[",
"str",
",",
"datetime",
".",
... | Get historical news headline.
https://interactivebrokers.github.io/tws-api/news.html
This method is blocking.
Args:
conId: Search news articles for contract with this conId.
providerCodes: A '+'-separated list of provider codes, like
'BZ+FLY'.
... | [
"Get",
"historical",
"news",
"headline",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1493-L1524 | train | Request historical news for a given contract with this conId. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ib.py | IB.replaceFA | def replaceFA(self, faDataType: int, xml: str):
"""
Replaces Financial Advisor's settings.
Args:
faDataType: See :meth:`.requestFA`.
xml: The XML-formatted configuration string.
"""
self.client.replaceFA(faDataType, xml) | python | def replaceFA(self, faDataType: int, xml: str):
"""
Replaces Financial Advisor's settings.
Args:
faDataType: See :meth:`.requestFA`.
xml: The XML-formatted configuration string.
"""
self.client.replaceFA(faDataType, xml) | [
"def",
"replaceFA",
"(",
"self",
",",
"faDataType",
":",
"int",
",",
"xml",
":",
"str",
")",
":",
"self",
".",
"client",
".",
"replaceFA",
"(",
"faDataType",
",",
"xml",
")"
] | Replaces Financial Advisor's settings.
Args:
faDataType: See :meth:`.requestFA`.
xml: The XML-formatted configuration string. | [
"Replaces",
"Financial",
"Advisor",
"s",
"settings",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ib.py#L1563-L1571 | train | Replaces Financial Advisor s settings. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/util.py | df | def df(objs, labels=None):
"""
Create pandas DataFrame from the sequence of same-type objects.
When a list of labels is given then only retain those labels and
drop the rest.
"""
import pandas as pd
from .objects import Object, DynamicObject
if objs:
objs = list(objs)
obj... | python | def df(objs, labels=None):
"""
Create pandas DataFrame from the sequence of same-type objects.
When a list of labels is given then only retain those labels and
drop the rest.
"""
import pandas as pd
from .objects import Object, DynamicObject
if objs:
objs = list(objs)
obj... | [
"def",
"df",
"(",
"objs",
",",
"labels",
"=",
"None",
")",
":",
"import",
"pandas",
"as",
"pd",
"from",
".",
"objects",
"import",
"Object",
",",
"DynamicObject",
"if",
"objs",
":",
"objs",
"=",
"list",
"(",
"objs",
")",
"obj",
"=",
"objs",
"[",
"0"... | Create pandas DataFrame from the sequence of same-type objects.
When a list of labels is given then only retain those labels and
drop the rest. | [
"Create",
"pandas",
"DataFrame",
"from",
"the",
"sequence",
"of",
"same",
"-",
"type",
"objects",
".",
"When",
"a",
"list",
"of",
"labels",
"is",
"given",
"then",
"only",
"retain",
"those",
"labels",
"and",
"drop",
"the",
"rest",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/util.py#L23-L49 | train | Create pandas DataFrame from a sequence of same - type objects. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/util.py | tree | def tree(obj):
"""
Convert object to a tree of lists, dicts and simple values.
The result can be serialized to JSON.
"""
from .objects import Object
if isinstance(obj, (bool, int, float, str, bytes)):
return obj
elif isinstance(obj, (datetime.date, datetime.time)):
return obj... | python | def tree(obj):
"""
Convert object to a tree of lists, dicts and simple values.
The result can be serialized to JSON.
"""
from .objects import Object
if isinstance(obj, (bool, int, float, str, bytes)):
return obj
elif isinstance(obj, (datetime.date, datetime.time)):
return obj... | [
"def",
"tree",
"(",
"obj",
")",
":",
"from",
".",
"objects",
"import",
"Object",
"if",
"isinstance",
"(",
"obj",
",",
"(",
"bool",
",",
"int",
",",
"float",
",",
"str",
",",
"bytes",
")",
")",
":",
"return",
"obj",
"elif",
"isinstance",
"(",
"obj",... | Convert object to a tree of lists, dicts and simple values.
The result can be serialized to JSON. | [
"Convert",
"object",
"to",
"a",
"tree",
"of",
"lists",
"dicts",
"and",
"simple",
"values",
".",
"The",
"result",
"can",
"be",
"serialized",
"to",
"JSON",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/util.py#L52-L69 | train | Convert object to a tree of lists dicts and simple values. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/util.py | barplot | def barplot(bars, title='', upColor='blue', downColor='red'):
"""
Create candlestick plot for the given bars. The bars can be given as
a DataFrame or as a list of bar objects.
"""
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from matplotlib.patc... | python | def barplot(bars, title='', upColor='blue', downColor='red'):
"""
Create candlestick plot for the given bars. The bars can be given as
a DataFrame or as a list of bar objects.
"""
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from matplotlib.patc... | [
"def",
"barplot",
"(",
"bars",
",",
"title",
"=",
"''",
",",
"upColor",
"=",
"'blue'",
",",
"downColor",
"=",
"'red'",
")",
":",
"import",
"pandas",
"as",
"pd",
"import",
"matplotlib",
".",
"pyplot",
"as",
"plt",
"from",
"matplotlib",
".",
"lines",
"im... | Create candlestick plot for the given bars. The bars can be given as
a DataFrame or as a list of bar objects. | [
"Create",
"candlestick",
"plot",
"for",
"the",
"given",
"bars",
".",
"The",
"bars",
"can",
"be",
"given",
"as",
"a",
"DataFrame",
"or",
"as",
"a",
"list",
"of",
"bar",
"objects",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/util.py#L72-L125 | train | Create candlestick plot for the given bars. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/util.py | logToFile | def logToFile(path, level=logging.INFO):
"""
Create a log handler that logs to the given file.
"""
logger = logging.getLogger()
logger.setLevel(level)
formatter = logging.Formatter(
'%(asctime)s %(name)s %(levelname)s %(message)s')
handler = logging.FileHandler(path)
handler.setF... | python | def logToFile(path, level=logging.INFO):
"""
Create a log handler that logs to the given file.
"""
logger = logging.getLogger()
logger.setLevel(level)
formatter = logging.Formatter(
'%(asctime)s %(name)s %(levelname)s %(message)s')
handler = logging.FileHandler(path)
handler.setF... | [
"def",
"logToFile",
"(",
"path",
",",
"level",
"=",
"logging",
".",
"INFO",
")",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
")",
"logger",
".",
"setLevel",
"(",
"level",
")",
"formatter",
"=",
"logging",
".",
"Formatter",
"(",
"'%(asctime)s %(... | Create a log handler that logs to the given file. | [
"Create",
"a",
"log",
"handler",
"that",
"logs",
"to",
"the",
"given",
"file",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/util.py#L135-L145 | train | Create a log handler that logs to the given file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/util.py | logToConsole | def logToConsole(level=logging.INFO):
"""
Create a log handler that logs to the console.
"""
logger = logging.getLogger()
logger.setLevel(level)
formatter = logging.Formatter(
'%(asctime)s %(name)s %(levelname)s %(message)s')
handler = logging.StreamHandler()
handler.setFormatter... | python | def logToConsole(level=logging.INFO):
"""
Create a log handler that logs to the console.
"""
logger = logging.getLogger()
logger.setLevel(level)
formatter = logging.Formatter(
'%(asctime)s %(name)s %(levelname)s %(message)s')
handler = logging.StreamHandler()
handler.setFormatter... | [
"def",
"logToConsole",
"(",
"level",
"=",
"logging",
".",
"INFO",
")",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
")",
"logger",
".",
"setLevel",
"(",
"level",
")",
"formatter",
"=",
"logging",
".",
"Formatter",
"(",
"'%(asctime)s %(name)s %(level... | Create a log handler that logs to the console. | [
"Create",
"a",
"log",
"handler",
"that",
"logs",
"to",
"the",
"console",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/util.py#L148-L161 | train | Create a log handler that logs to the console. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/util.py | formatSI | def formatSI(n) -> str:
"""
Format the integer or float n to 3 significant digits + SI prefix.
"""
s = ''
if n < 0:
n = -n
s += '-'
if type(n) is int and n < 1000:
s = str(n) + ' '
elif n < 1e-22:
s = '0.00 '
else:
assert n < 9.99e26
log = ... | python | def formatSI(n) -> str:
"""
Format the integer or float n to 3 significant digits + SI prefix.
"""
s = ''
if n < 0:
n = -n
s += '-'
if type(n) is int and n < 1000:
s = str(n) + ' '
elif n < 1e-22:
s = '0.00 '
else:
assert n < 9.99e26
log = ... | [
"def",
"formatSI",
"(",
"n",
")",
"->",
"str",
":",
"s",
"=",
"''",
"if",
"n",
"<",
"0",
":",
"n",
"=",
"-",
"n",
"s",
"+=",
"'-'",
"if",
"type",
"(",
"n",
")",
"is",
"int",
"and",
"n",
"<",
"1000",
":",
"s",
"=",
"str",
"(",
"n",
")",
... | Format the integer or float n to 3 significant digits + SI prefix. | [
"Format",
"the",
"integer",
"or",
"float",
"n",
"to",
"3",
"significant",
"digits",
"+",
"SI",
"prefix",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/util.py#L171-L197 | train | Format the integer or float n to 3 significant digits + SI prefix. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/util.py | run | def run(*awaitables, timeout: float = None):
"""
By default run the event loop forever.
When awaitables (like Tasks, Futures or coroutines) are given then
run the event loop until each has completed and return their results.
An optional timeout (in seconds) can be given that will raise
asyncio... | python | def run(*awaitables, timeout: float = None):
"""
By default run the event loop forever.
When awaitables (like Tasks, Futures or coroutines) are given then
run the event loop until each has completed and return their results.
An optional timeout (in seconds) can be given that will raise
asyncio... | [
"def",
"run",
"(",
"*",
"awaitables",
",",
"timeout",
":",
"float",
"=",
"None",
")",
":",
"loop",
"=",
"asyncio",
".",
"get_event_loop",
"(",
")",
"if",
"not",
"awaitables",
":",
"if",
"loop",
".",
"is_running",
"(",
")",
":",
"return",
"loop",
".",... | By default run the event loop forever.
When awaitables (like Tasks, Futures or coroutines) are given then
run the event loop until each has completed and return their results.
An optional timeout (in seconds) can be given that will raise
asyncio.TimeoutError if the awaitables are not ready within the
... | [
"By",
"default",
"run",
"the",
"event",
"loop",
"forever",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/util.py#L214-L257 | train | Run the given asynchronous tasks and return the result. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/util.py | schedule | def schedule(
time: Union[datetime.time, datetime.datetime],
callback: Callable, *args):
"""
Schedule the callback to be run at the given time with
the given arguments.
Args:
time: Time to run callback. If given as :py:class:`datetime.time`
then use today as date.
... | python | def schedule(
time: Union[datetime.time, datetime.datetime],
callback: Callable, *args):
"""
Schedule the callback to be run at the given time with
the given arguments.
Args:
time: Time to run callback. If given as :py:class:`datetime.time`
then use today as date.
... | [
"def",
"schedule",
"(",
"time",
":",
"Union",
"[",
"datetime",
".",
"time",
",",
"datetime",
".",
"datetime",
"]",
",",
"callback",
":",
"Callable",
",",
"*",
"args",
")",
":",
"dt",
"=",
"_fillDate",
"(",
"time",
")",
"now",
"=",
"datetime",
".",
... | Schedule the callback to be run at the given time with
the given arguments.
Args:
time: Time to run callback. If given as :py:class:`datetime.time`
then use today as date.
callback: Callable scheduled to run.
args: Arguments for to call callback with. | [
"Schedule",
"the",
"callback",
"to",
"be",
"run",
"at",
"the",
"given",
"time",
"with",
"the",
"given",
"arguments",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/util.py#L269-L286 | train | Schedules the given callback to be run at the given time. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/util.py | timeRange | def timeRange(
start: datetime.time, end: datetime.time,
step: float) -> Iterator[datetime.datetime]:
"""
Iterator that waits periodically until certain time points are
reached while yielding those time points.
Args:
start: Start time, can be specified as datetime.datetime,
... | python | def timeRange(
start: datetime.time, end: datetime.time,
step: float) -> Iterator[datetime.datetime]:
"""
Iterator that waits periodically until certain time points are
reached while yielding those time points.
Args:
start: Start time, can be specified as datetime.datetime,
... | [
"def",
"timeRange",
"(",
"start",
":",
"datetime",
".",
"time",
",",
"end",
":",
"datetime",
".",
"time",
",",
"step",
":",
"float",
")",
"->",
"Iterator",
"[",
"datetime",
".",
"datetime",
"]",
":",
"assert",
"step",
">",
"0",
"start",
"=",
"_fillDa... | Iterator that waits periodically until certain time points are
reached while yielding those time points.
Args:
start: Start time, can be specified as datetime.datetime,
or as datetime.time in which case today is used as the date
end: End time, can be specified as datetime.datetime,
... | [
"Iterator",
"that",
"waits",
"periodically",
"until",
"certain",
"time",
"points",
"are",
"reached",
"while",
"yielding",
"those",
"time",
"points",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/util.py#L301-L325 | train | Returns an iterator that waits periodically until certain time points are reached while yielding those time points. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/util.py | timeRangeAsync | async def timeRangeAsync(
start: datetime.time, end: datetime.time,
step: float) -> AsyncIterator[datetime.datetime]:
"""
Async version of :meth:`timeRange`.
"""
assert step > 0
start = _fillDate(start)
end = _fillDate(end)
delta = datetime.timedelta(seconds=step)
t = sta... | python | async def timeRangeAsync(
start: datetime.time, end: datetime.time,
step: float) -> AsyncIterator[datetime.datetime]:
"""
Async version of :meth:`timeRange`.
"""
assert step > 0
start = _fillDate(start)
end = _fillDate(end)
delta = datetime.timedelta(seconds=step)
t = sta... | [
"async",
"def",
"timeRangeAsync",
"(",
"start",
":",
"datetime",
".",
"time",
",",
"end",
":",
"datetime",
".",
"time",
",",
"step",
":",
"float",
")",
"->",
"AsyncIterator",
"[",
"datetime",
".",
"datetime",
"]",
":",
"assert",
"step",
">",
"0",
"star... | Async version of :meth:`timeRange`. | [
"Async",
"version",
"of",
":",
"meth",
":",
"timeRange",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/util.py#L343-L359 | train | A generator that returns the time range of the current node. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/util.py | waitUntilAsync | async def waitUntilAsync(t: datetime.time) -> bool:
"""
Async version of :meth:`waitUntil`.
"""
t = _fillDate(t)
now = datetime.datetime.now(t.tzinfo)
secs = (t - now).total_seconds()
await asyncio.sleep(secs)
return True | python | async def waitUntilAsync(t: datetime.time) -> bool:
"""
Async version of :meth:`waitUntil`.
"""
t = _fillDate(t)
now = datetime.datetime.now(t.tzinfo)
secs = (t - now).total_seconds()
await asyncio.sleep(secs)
return True | [
"async",
"def",
"waitUntilAsync",
"(",
"t",
":",
"datetime",
".",
"time",
")",
"->",
"bool",
":",
"t",
"=",
"_fillDate",
"(",
"t",
")",
"now",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
"t",
".",
"tzinfo",
")",
"secs",
"=",
"(",
"t",
"-",... | Async version of :meth:`waitUntil`. | [
"Async",
"version",
"of",
":",
"meth",
":",
"waitUntil",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/util.py#L362-L370 | train | Await until t is reached. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/util.py | startLoop | def startLoop():
"""
Use nested asyncio event loop for Jupyter notebooks.
"""
def _ipython_loop_asyncio(kernel):
'''
Use asyncio event loop for the given IPython kernel.
'''
loop = asyncio.get_event_loop()
def kernel_handler():
kernel.do_one_iteration... | python | def startLoop():
"""
Use nested asyncio event loop for Jupyter notebooks.
"""
def _ipython_loop_asyncio(kernel):
'''
Use asyncio event loop for the given IPython kernel.
'''
loop = asyncio.get_event_loop()
def kernel_handler():
kernel.do_one_iteration... | [
"def",
"startLoop",
"(",
")",
":",
"def",
"_ipython_loop_asyncio",
"(",
"kernel",
")",
":",
"'''\n Use asyncio event loop for the given IPython kernel.\n '''",
"loop",
"=",
"asyncio",
".",
"get_event_loop",
"(",
")",
"def",
"kernel_handler",
"(",
")",
":",... | Use nested asyncio event loop for Jupyter notebooks. | [
"Use",
"nested",
"asyncio",
"event",
"loop",
"for",
"Jupyter",
"notebooks",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/util.py#L381-L409 | train | Start the main loop for Jupyter notebooks. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/util.py | useQt | def useQt(qtLib: str = 'PyQt5', period: float = 0.01):
"""
Run combined Qt5/asyncio event loop.
Args:
qtLib: Name of Qt library to use, can be 'PyQt5' or 'PySide2'.
period: Period in seconds to poll Qt.
"""
def qt_step():
loop.call_later(period, qt_step)
if not stack... | python | def useQt(qtLib: str = 'PyQt5', period: float = 0.01):
"""
Run combined Qt5/asyncio event loop.
Args:
qtLib: Name of Qt library to use, can be 'PyQt5' or 'PySide2'.
period: Period in seconds to poll Qt.
"""
def qt_step():
loop.call_later(period, qt_step)
if not stack... | [
"def",
"useQt",
"(",
"qtLib",
":",
"str",
"=",
"'PyQt5'",
",",
"period",
":",
"float",
"=",
"0.01",
")",
":",
"def",
"qt_step",
"(",
")",
":",
"loop",
".",
"call_later",
"(",
"period",
",",
"qt_step",
")",
"if",
"not",
"stack",
":",
"qloop",
"=",
... | Run combined Qt5/asyncio event loop.
Args:
qtLib: Name of Qt library to use, can be 'PyQt5' or 'PySide2'.
period: Period in seconds to poll Qt. | [
"Run",
"combined",
"Qt5",
"/",
"asyncio",
"event",
"loop",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/util.py#L412-L444 | train | Run combined Qt event loop. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/util.py | formatIBDatetime | def formatIBDatetime(dt) -> str:
"""
Format date or datetime to string that IB uses.
"""
if not dt:
s = ''
elif isinstance(dt, datetime.datetime):
if dt.tzinfo:
# convert to local system timezone
dt = dt.astimezone()
s = dt.strftime('%Y%m%d %H:%M:%S')
... | python | def formatIBDatetime(dt) -> str:
"""
Format date or datetime to string that IB uses.
"""
if not dt:
s = ''
elif isinstance(dt, datetime.datetime):
if dt.tzinfo:
# convert to local system timezone
dt = dt.astimezone()
s = dt.strftime('%Y%m%d %H:%M:%S')
... | [
"def",
"formatIBDatetime",
"(",
"dt",
")",
"->",
"str",
":",
"if",
"not",
"dt",
":",
"s",
"=",
"''",
"elif",
"isinstance",
"(",
"dt",
",",
"datetime",
".",
"datetime",
")",
":",
"if",
"dt",
".",
"tzinfo",
":",
"# convert to local system timezone",
"dt",
... | Format date or datetime to string that IB uses. | [
"Format",
"date",
"or",
"datetime",
"to",
"string",
"that",
"IB",
"uses",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/util.py#L447-L462 | train | Format date or datetime to string that IB uses. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/util.py | parseIBDatetime | def parseIBDatetime(s):
"""
Parse string in IB date or datetime format to datetime.
"""
if len(s) == 8:
# YYYYmmdd
y = int(s[0:4])
m = int(s[4:6])
d = int(s[6:8])
dt = datetime.date(y, m, d)
elif s.isdigit():
dt = datetime.datetime.fromtimestamp(
... | python | def parseIBDatetime(s):
"""
Parse string in IB date or datetime format to datetime.
"""
if len(s) == 8:
# YYYYmmdd
y = int(s[0:4])
m = int(s[4:6])
d = int(s[6:8])
dt = datetime.date(y, m, d)
elif s.isdigit():
dt = datetime.datetime.fromtimestamp(
... | [
"def",
"parseIBDatetime",
"(",
"s",
")",
":",
"if",
"len",
"(",
"s",
")",
"==",
"8",
":",
"# YYYYmmdd",
"y",
"=",
"int",
"(",
"s",
"[",
"0",
":",
"4",
"]",
")",
"m",
"=",
"int",
"(",
"s",
"[",
"4",
":",
"6",
"]",
")",
"d",
"=",
"int",
"... | Parse string in IB date or datetime format to datetime. | [
"Parse",
"string",
"in",
"IB",
"date",
"or",
"datetime",
"format",
"to",
"datetime",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/util.py#L465-L480 | train | Parse string in IB date or datetime format to datetime. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/objects.py | Object.tuple | def tuple(self):
"""
Return values as a tuple.
"""
return tuple(getattr(self, k) for k in self.__class__.defaults) | python | def tuple(self):
"""
Return values as a tuple.
"""
return tuple(getattr(self, k) for k in self.__class__.defaults) | [
"def",
"tuple",
"(",
"self",
")",
":",
"return",
"tuple",
"(",
"getattr",
"(",
"self",
",",
"k",
")",
"for",
"k",
"in",
"self",
".",
"__class__",
".",
"defaults",
")"
] | Return values as a tuple. | [
"Return",
"values",
"as",
"a",
"tuple",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/objects.py#L61-L65 | train | Return values as a tuple. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/objects.py | Object.dict | def dict(self):
"""
Return key-value pairs as a dictionary.
"""
return {k: getattr(self, k) for k in self.__class__.defaults} | python | def dict(self):
"""
Return key-value pairs as a dictionary.
"""
return {k: getattr(self, k) for k in self.__class__.defaults} | [
"def",
"dict",
"(",
"self",
")",
":",
"return",
"{",
"k",
":",
"getattr",
"(",
"self",
",",
"k",
")",
"for",
"k",
"in",
"self",
".",
"__class__",
".",
"defaults",
"}"
] | Return key-value pairs as a dictionary. | [
"Return",
"key",
"-",
"value",
"pairs",
"as",
"a",
"dictionary",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/objects.py#L67-L71 | train | Return key - value pairs as a dictionary. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/objects.py | Object.diff | def diff(self, other):
"""
Return differences between self and other as dictionary of 2-tuples.
"""
diff = {}
for k in self.__class__.defaults:
left = getattr(self, k)
right = getattr(other, k)
if left != right:
diff[k] = (left,... | python | def diff(self, other):
"""
Return differences between self and other as dictionary of 2-tuples.
"""
diff = {}
for k in self.__class__.defaults:
left = getattr(self, k)
right = getattr(other, k)
if left != right:
diff[k] = (left,... | [
"def",
"diff",
"(",
"self",
",",
"other",
")",
":",
"diff",
"=",
"{",
"}",
"for",
"k",
"in",
"self",
".",
"__class__",
".",
"defaults",
":",
"left",
"=",
"getattr",
"(",
"self",
",",
"k",
")",
"right",
"=",
"getattr",
"(",
"other",
",",
"k",
")... | Return differences between self and other as dictionary of 2-tuples. | [
"Return",
"differences",
"between",
"self",
"and",
"other",
"as",
"dictionary",
"of",
"2",
"-",
"tuples",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/objects.py#L81-L91 | train | Return differences between self and other as dictionary of 2 - tuples. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/objects.py | Object.nonDefaults | def nonDefaults(self):
"""
Get a dictionary of all attributes that differ from the default.
"""
nonDefaults = {}
for k, d in self.__class__.defaults.items():
v = getattr(self, k)
if v != d and (v == v or d == d): # tests for NaN too
nonDef... | python | def nonDefaults(self):
"""
Get a dictionary of all attributes that differ from the default.
"""
nonDefaults = {}
for k, d in self.__class__.defaults.items():
v = getattr(self, k)
if v != d and (v == v or d == d): # tests for NaN too
nonDef... | [
"def",
"nonDefaults",
"(",
"self",
")",
":",
"nonDefaults",
"=",
"{",
"}",
"for",
"k",
",",
"d",
"in",
"self",
".",
"__class__",
".",
"defaults",
".",
"items",
"(",
")",
":",
"v",
"=",
"getattr",
"(",
"self",
",",
"k",
")",
"if",
"v",
"!=",
"d"... | Get a dictionary of all attributes that differ from the default. | [
"Get",
"a",
"dictionary",
"of",
"all",
"attributes",
"that",
"differ",
"from",
"the",
"default",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/objects.py#L93-L102 | train | Get a dictionary of all attributes that differ from the default. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/wrapper.py | Wrapper.startReq | def startReq(self, key, contract=None, container=None):
"""
Start a new request and return the future that is associated
with with the key and container. The container is a list by default.
"""
future = asyncio.Future()
self._futures[key] = future
self._results[ke... | python | def startReq(self, key, contract=None, container=None):
"""
Start a new request and return the future that is associated
with with the key and container. The container is a list by default.
"""
future = asyncio.Future()
self._futures[key] = future
self._results[ke... | [
"def",
"startReq",
"(",
"self",
",",
"key",
",",
"contract",
"=",
"None",
",",
"container",
"=",
"None",
")",
":",
"future",
"=",
"asyncio",
".",
"Future",
"(",
")",
"self",
".",
"_futures",
"[",
"key",
"]",
"=",
"future",
"self",
".",
"_results",
... | Start a new request and return the future that is associated
with with the key and container. The container is a list by default. | [
"Start",
"a",
"new",
"request",
"and",
"return",
"the",
"future",
"that",
"is",
"associated",
"with",
"with",
"the",
"key",
"and",
"container",
".",
"The",
"container",
"is",
"a",
"list",
"by",
"default",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/wrapper.py#L76-L86 | train | Start a new request and return the future that is associated
with the key and container. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/wrapper.py | Wrapper._endReq | def _endReq(self, key, result=None, success=True):
"""
Finish the future of corresponding key with the given result.
If no result is given then it will be popped of the general results.
"""
future = self._futures.pop(key, None)
self._reqId2Contract.pop(key, None)
... | python | def _endReq(self, key, result=None, success=True):
"""
Finish the future of corresponding key with the given result.
If no result is given then it will be popped of the general results.
"""
future = self._futures.pop(key, None)
self._reqId2Contract.pop(key, None)
... | [
"def",
"_endReq",
"(",
"self",
",",
"key",
",",
"result",
"=",
"None",
",",
"success",
"=",
"True",
")",
":",
"future",
"=",
"self",
".",
"_futures",
".",
"pop",
"(",
"key",
",",
"None",
")",
"self",
".",
"_reqId2Contract",
".",
"pop",
"(",
"key",
... | Finish the future of corresponding key with the given result.
If no result is given then it will be popped of the general results. | [
"Finish",
"the",
"future",
"of",
"corresponding",
"key",
"with",
"the",
"given",
"result",
".",
"If",
"no",
"result",
"is",
"given",
"then",
"it",
"will",
"be",
"popped",
"of",
"the",
"general",
"results",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/wrapper.py#L88-L102 | train | Finish the future of corresponding key with the given result. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/wrapper.py | Wrapper.startTicker | def startTicker(self, reqId, contract, tickType):
"""
Start a tick request that has the reqId associated with the contract.
Return the ticker.
"""
ticker = self.tickers.get(id(contract))
if not ticker:
ticker = Ticker(
contract=contract, ticks=... | python | def startTicker(self, reqId, contract, tickType):
"""
Start a tick request that has the reqId associated with the contract.
Return the ticker.
"""
ticker = self.tickers.get(id(contract))
if not ticker:
ticker = Ticker(
contract=contract, ticks=... | [
"def",
"startTicker",
"(",
"self",
",",
"reqId",
",",
"contract",
",",
"tickType",
")",
":",
"ticker",
"=",
"self",
".",
"tickers",
".",
"get",
"(",
"id",
"(",
"contract",
")",
")",
"if",
"not",
"ticker",
":",
"ticker",
"=",
"Ticker",
"(",
"contract"... | Start a tick request that has the reqId associated with the contract.
Return the ticker. | [
"Start",
"a",
"tick",
"request",
"that",
"has",
"the",
"reqId",
"associated",
"with",
"the",
"contract",
".",
"Return",
"the",
"ticker",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/wrapper.py#L104-L118 | train | Start a tick request that has the reqId associated with the contract. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/wrapper.py | Wrapper.startSubscription | def startSubscription(self, reqId, subscriber, contract=None):
"""
Register a live subscription.
"""
self._reqId2Contract[reqId] = contract
self.reqId2Subscriber[reqId] = subscriber | python | def startSubscription(self, reqId, subscriber, contract=None):
"""
Register a live subscription.
"""
self._reqId2Contract[reqId] = contract
self.reqId2Subscriber[reqId] = subscriber | [
"def",
"startSubscription",
"(",
"self",
",",
"reqId",
",",
"subscriber",
",",
"contract",
"=",
"None",
")",
":",
"self",
".",
"_reqId2Contract",
"[",
"reqId",
"]",
"=",
"contract",
"self",
".",
"reqId2Subscriber",
"[",
"reqId",
"]",
"=",
"subscriber"
] | Register a live subscription. | [
"Register",
"a",
"live",
"subscription",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/wrapper.py#L125-L130 | train | Start a live subscription. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/wrapper.py | Wrapper.endSubscription | def endSubscription(self, subscriber):
"""
Unregister a live subscription.
"""
self._reqId2Contract.pop(subscriber.reqId, None)
self.reqId2Subscriber.pop(subscriber.reqId, None) | python | def endSubscription(self, subscriber):
"""
Unregister a live subscription.
"""
self._reqId2Contract.pop(subscriber.reqId, None)
self.reqId2Subscriber.pop(subscriber.reqId, None) | [
"def",
"endSubscription",
"(",
"self",
",",
"subscriber",
")",
":",
"self",
".",
"_reqId2Contract",
".",
"pop",
"(",
"subscriber",
".",
"reqId",
",",
"None",
")",
"self",
".",
"reqId2Subscriber",
".",
"pop",
"(",
"subscriber",
".",
"reqId",
",",
"None",
... | Unregister a live subscription. | [
"Unregister",
"a",
"live",
"subscription",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/wrapper.py#L132-L137 | train | End a live subscription. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/wrapper.py | Wrapper.openOrder | def openOrder(self, orderId, contract, order, orderState):
"""
This wrapper is called to:
* feed in open orders at startup;
* feed in open orders or order updates from other clients and TWS
if clientId=master id;
* feed in manual orders and order updates from TWS if cl... | python | def openOrder(self, orderId, contract, order, orderState):
"""
This wrapper is called to:
* feed in open orders at startup;
* feed in open orders or order updates from other clients and TWS
if clientId=master id;
* feed in manual orders and order updates from TWS if cl... | [
"def",
"openOrder",
"(",
"self",
",",
"orderId",
",",
"contract",
",",
"order",
",",
"orderState",
")",
":",
"if",
"order",
".",
"whatIf",
":",
"# response to whatIfOrder",
"self",
".",
"_endReq",
"(",
"order",
".",
"orderId",
",",
"orderState",
")",
"else... | This wrapper is called to:
* feed in open orders at startup;
* feed in open orders or order updates from other clients and TWS
if clientId=master id;
* feed in manual orders and order updates from TWS if clientId=0;
* handle openOrders and allOpenOrders responses. | [
"This",
"wrapper",
"is",
"called",
"to",
":"
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/wrapper.py#L267-L299 | train | This wrapper is called by the order manager when a new order is created. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/wrapper.py | Wrapper.execDetails | def execDetails(self, reqId, contract, execution):
"""
This wrapper handles both live fills and responses to reqExecutions.
"""
if execution.orderId == UNSET_INTEGER:
# bug in TWS: executions of manual orders have unset value
execution.orderId = 0
key = se... | python | def execDetails(self, reqId, contract, execution):
"""
This wrapper handles both live fills and responses to reqExecutions.
"""
if execution.orderId == UNSET_INTEGER:
# bug in TWS: executions of manual orders have unset value
execution.orderId = 0
key = se... | [
"def",
"execDetails",
"(",
"self",
",",
"reqId",
",",
"contract",
",",
"execution",
")",
":",
"if",
"execution",
".",
"orderId",
"==",
"UNSET_INTEGER",
":",
"# bug in TWS: executions of manual orders have unset value",
"execution",
".",
"orderId",
"=",
"0",
"key",
... | This wrapper handles both live fills and responses to reqExecutions. | [
"This",
"wrapper",
"handles",
"both",
"live",
"fills",
"and",
"responses",
"to",
"reqExecutions",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/wrapper.py#L347-L382 | train | This wrapper handles both live fills and responses and responses from a request. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/client.py | Client.connectionStats | def connectionStats(self) -> ConnectionStats:
"""
Get statistics about the connection.
"""
if not self.isReady():
raise ConnectionError('Not connected')
return ConnectionStats(
self._startTime,
time.time() - self._startTime,
self._n... | python | def connectionStats(self) -> ConnectionStats:
"""
Get statistics about the connection.
"""
if not self.isReady():
raise ConnectionError('Not connected')
return ConnectionStats(
self._startTime,
time.time() - self._startTime,
self._n... | [
"def",
"connectionStats",
"(",
"self",
")",
"->",
"ConnectionStats",
":",
"if",
"not",
"self",
".",
"isReady",
"(",
")",
":",
"raise",
"ConnectionError",
"(",
"'Not connected'",
")",
"return",
"ConnectionStats",
"(",
"self",
".",
"_startTime",
",",
"time",
"... | Get statistics about the connection. | [
"Get",
"statistics",
"about",
"the",
"connection",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/client.py#L137-L147 | train | Get statistics about the connection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/client.py | Client.getReqId | def getReqId(self) -> int:
"""
Get new request ID.
"""
if not self.isReady():
raise ConnectionError('Not connected')
newId = self._reqIdSeq
self._reqIdSeq += 1
return newId | python | def getReqId(self) -> int:
"""
Get new request ID.
"""
if not self.isReady():
raise ConnectionError('Not connected')
newId = self._reqIdSeq
self._reqIdSeq += 1
return newId | [
"def",
"getReqId",
"(",
"self",
")",
"->",
"int",
":",
"if",
"not",
"self",
".",
"isReady",
"(",
")",
":",
"raise",
"ConnectionError",
"(",
"'Not connected'",
")",
"newId",
"=",
"self",
".",
"_reqIdSeq",
"self",
".",
"_reqIdSeq",
"+=",
"1",
"return",
"... | Get new request ID. | [
"Get",
"new",
"request",
"ID",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/client.py#L149-L157 | train | Get a unique request ID. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/client.py | Client.disconnect | def disconnect(self):
"""
Disconnect from IB connection.
"""
self.connState = Client.DISCONNECTED
if self.conn is not None:
self._logger.info('Disconnecting')
self.conn.disconnect()
self.wrapper.connectionClosed()
self.reset() | python | def disconnect(self):
"""
Disconnect from IB connection.
"""
self.connState = Client.DISCONNECTED
if self.conn is not None:
self._logger.info('Disconnecting')
self.conn.disconnect()
self.wrapper.connectionClosed()
self.reset() | [
"def",
"disconnect",
"(",
"self",
")",
":",
"self",
".",
"connState",
"=",
"Client",
".",
"DISCONNECTED",
"if",
"self",
".",
"conn",
"is",
"not",
"None",
":",
"self",
".",
"_logger",
".",
"info",
"(",
"'Disconnecting'",
")",
"self",
".",
"conn",
".",
... | Disconnect from IB connection. | [
"Disconnect",
"from",
"IB",
"connection",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/client.py#L222-L231 | train | Disconnect from IB connection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/client.py | Client.send | def send(self, *fields):
"""
Serialize and send the given fields using the IB socket protocol.
"""
if not self.isConnected():
raise ConnectionError('Not connected')
msg = io.StringIO()
for field in fields:
typ = type(field)
if field in... | python | def send(self, *fields):
"""
Serialize and send the given fields using the IB socket protocol.
"""
if not self.isConnected():
raise ConnectionError('Not connected')
msg = io.StringIO()
for field in fields:
typ = type(field)
if field in... | [
"def",
"send",
"(",
"self",
",",
"*",
"fields",
")",
":",
"if",
"not",
"self",
".",
"isConnected",
"(",
")",
":",
"raise",
"ConnectionError",
"(",
"'Not connected'",
")",
"msg",
"=",
"io",
".",
"StringIO",
"(",
")",
"for",
"field",
"in",
"fields",
":... | Serialize and send the given fields using the IB socket protocol. | [
"Serialize",
"and",
"send",
"the",
"given",
"fields",
"using",
"the",
"IB",
"socket",
"protocol",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/client.py#L233-L264 | train | Serialize and send the given fields using the IB socket protocol. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/decoder.py | Decoder.wrap | def wrap(self, methodName, types, skip=2):
"""
Create a message handler that invokes a wrapper method
with the in-order message fields as parameters, skipping over
the first ``skip`` fields, and parsed according to the ``types`` list.
"""
def handler(fields):
... | python | def wrap(self, methodName, types, skip=2):
"""
Create a message handler that invokes a wrapper method
with the in-order message fields as parameters, skipping over
the first ``skip`` fields, and parsed according to the ``types`` list.
"""
def handler(fields):
... | [
"def",
"wrap",
"(",
"self",
",",
"methodName",
",",
"types",
",",
"skip",
"=",
"2",
")",
":",
"def",
"handler",
"(",
"fields",
")",
":",
"try",
":",
"args",
"=",
"[",
"field",
"if",
"typ",
"is",
"str",
"else",
"int",
"(",
"field",
"or",
"0",
")... | Create a message handler that invokes a wrapper method
with the in-order message fields as parameters, skipping over
the first ``skip`` fields, and parsed according to the ``types`` list. | [
"Create",
"a",
"message",
"handler",
"that",
"invokes",
"a",
"wrapper",
"method",
"with",
"the",
"in",
"-",
"order",
"message",
"fields",
"as",
"parameters",
"skipping",
"over",
"the",
"first",
"skip",
"fields",
"and",
"parsed",
"according",
"to",
"the",
"ty... | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/decoder.py#L159-L179 | train | Create a message handler that invokes a wrapper method with the in - order message fields as parameters skipping over the first skip fields. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/decoder.py | Decoder.interpret | def interpret(self, fields):
"""
Decode fields and invoke corresponding wrapper method.
"""
try:
msgId = int(fields[0])
handler = self.handlers[msgId]
handler(fields)
except Exception:
self.logger.exception(f'Error handling fields: ... | python | def interpret(self, fields):
"""
Decode fields and invoke corresponding wrapper method.
"""
try:
msgId = int(fields[0])
handler = self.handlers[msgId]
handler(fields)
except Exception:
self.logger.exception(f'Error handling fields: ... | [
"def",
"interpret",
"(",
"self",
",",
"fields",
")",
":",
"try",
":",
"msgId",
"=",
"int",
"(",
"fields",
"[",
"0",
"]",
")",
"handler",
"=",
"self",
".",
"handlers",
"[",
"msgId",
"]",
"handler",
"(",
"fields",
")",
"except",
"Exception",
":",
"se... | Decode fields and invoke corresponding wrapper method. | [
"Decode",
"fields",
"and",
"invoke",
"corresponding",
"wrapper",
"method",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/decoder.py#L181-L190 | train | Decode fields and invoke corresponding wrapper method. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/decoder.py | Decoder.parse | def parse(self, obj):
"""
Parse the object's properties according to its default types.
"""
for k, default in obj.__class__.defaults.items():
typ = type(default)
if typ is str:
continue
v = getattr(obj, k)
if typ is int:
... | python | def parse(self, obj):
"""
Parse the object's properties according to its default types.
"""
for k, default in obj.__class__.defaults.items():
typ = type(default)
if typ is str:
continue
v = getattr(obj, k)
if typ is int:
... | [
"def",
"parse",
"(",
"self",
",",
"obj",
")",
":",
"for",
"k",
",",
"default",
"in",
"obj",
".",
"__class__",
".",
"defaults",
".",
"items",
"(",
")",
":",
"typ",
"=",
"type",
"(",
"default",
")",
"if",
"typ",
"is",
"str",
":",
"continue",
"v",
... | Parse the object's properties according to its default types. | [
"Parse",
"the",
"object",
"s",
"properties",
"according",
"to",
"its",
"default",
"types",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/decoder.py#L192-L206 | train | Parse the object s properties according to its default types. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/flexreport.py | FlexReport.topics | def topics(self):
"""
Get the set of topics that can be extracted from this report.
"""
return set(node.tag for node in self.root.iter() if node.attrib) | python | def topics(self):
"""
Get the set of topics that can be extracted from this report.
"""
return set(node.tag for node in self.root.iter() if node.attrib) | [
"def",
"topics",
"(",
"self",
")",
":",
"return",
"set",
"(",
"node",
".",
"tag",
"for",
"node",
"in",
"self",
".",
"root",
".",
"iter",
"(",
")",
"if",
"node",
".",
"attrib",
")"
] | Get the set of topics that can be extracted from this report. | [
"Get",
"the",
"set",
"of",
"topics",
"that",
"can",
"be",
"extracted",
"from",
"this",
"report",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/flexreport.py#L49-L53 | train | Get the set of topics that can be extracted from this report. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/flexreport.py | FlexReport.extract | def extract(self, topic: str, parseNumbers=True) -> list:
"""
Extract items of given topic and return as list of objects.
The topic is a string like TradeConfirm, ChangeInDividendAccrual,
Order, etc.
"""
cls = type(topic, (DynamicObject,), {})
results = [cls(**no... | python | def extract(self, topic: str, parseNumbers=True) -> list:
"""
Extract items of given topic and return as list of objects.
The topic is a string like TradeConfirm, ChangeInDividendAccrual,
Order, etc.
"""
cls = type(topic, (DynamicObject,), {})
results = [cls(**no... | [
"def",
"extract",
"(",
"self",
",",
"topic",
":",
"str",
",",
"parseNumbers",
"=",
"True",
")",
"->",
"list",
":",
"cls",
"=",
"type",
"(",
"topic",
",",
"(",
"DynamicObject",
",",
")",
",",
"{",
"}",
")",
"results",
"=",
"[",
"cls",
"(",
"*",
... | Extract items of given topic and return as list of objects.
The topic is a string like TradeConfirm, ChangeInDividendAccrual,
Order, etc. | [
"Extract",
"items",
"of",
"given",
"topic",
"and",
"return",
"as",
"list",
"of",
"objects",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/flexreport.py#L55-L71 | train | Extract items of given topic and return as list of objects. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/flexreport.py | FlexReport.df | def df(self, topic: str, parseNumbers=True):
"""
Same as extract but return the result as a pandas DataFrame.
"""
return util.df(self.extract(topic, parseNumbers)) | python | def df(self, topic: str, parseNumbers=True):
"""
Same as extract but return the result as a pandas DataFrame.
"""
return util.df(self.extract(topic, parseNumbers)) | [
"def",
"df",
"(",
"self",
",",
"topic",
":",
"str",
",",
"parseNumbers",
"=",
"True",
")",
":",
"return",
"util",
".",
"df",
"(",
"self",
".",
"extract",
"(",
"topic",
",",
"parseNumbers",
")",
")"
] | Same as extract but return the result as a pandas DataFrame. | [
"Same",
"as",
"extract",
"but",
"return",
"the",
"result",
"as",
"a",
"pandas",
"DataFrame",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/flexreport.py#L73-L77 | train | Returns the result as a pandas DataFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/flexreport.py | FlexReport.download | def download(self, token, queryId):
"""
Download report for the given ``token`` and ``queryId``.
"""
url = (
'https://gdcdyn.interactivebrokers.com'
f'/Universal/servlet/FlexStatementService.SendRequest?'
f't={token}&q={queryId}&v=3')
... | python | def download(self, token, queryId):
"""
Download report for the given ``token`` and ``queryId``.
"""
url = (
'https://gdcdyn.interactivebrokers.com'
f'/Universal/servlet/FlexStatementService.SendRequest?'
f't={token}&q={queryId}&v=3')
... | [
"def",
"download",
"(",
"self",
",",
"token",
",",
"queryId",
")",
":",
"url",
"=",
"(",
"'https://gdcdyn.interactivebrokers.com'",
"f'/Universal/servlet/FlexStatementService.SendRequest?'",
"f't={token}&q={queryId}&v=3'",
")",
"resp",
"=",
"urlopen",
"(",
"url",
")",
"... | Download report for the given ``token`` and ``queryId``. | [
"Download",
"report",
"for",
"the",
"given",
"token",
"and",
"queryId",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/flexreport.py#L79-L114 | train | Download report for the given token and queryId. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/flexreport.py | FlexReport.load | def load(self, path):
"""
Load report from XML file.
"""
with open(path, 'rb') as f:
self.data = f.read()
self.root = et.fromstring(self.data) | python | def load(self, path):
"""
Load report from XML file.
"""
with open(path, 'rb') as f:
self.data = f.read()
self.root = et.fromstring(self.data) | [
"def",
"load",
"(",
"self",
",",
"path",
")",
":",
"with",
"open",
"(",
"path",
",",
"'rb'",
")",
"as",
"f",
":",
"self",
".",
"data",
"=",
"f",
".",
"read",
"(",
")",
"self",
".",
"root",
"=",
"et",
".",
"fromstring",
"(",
"self",
".",
"data... | Load report from XML file. | [
"Load",
"report",
"from",
"XML",
"file",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/flexreport.py#L116-L122 | train | Load report from XML file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/flexreport.py | FlexReport.save | def save(self, path):
"""
Save report to XML file.
"""
with open(path, 'wb') as f:
f.write(self.data) | python | def save(self, path):
"""
Save report to XML file.
"""
with open(path, 'wb') as f:
f.write(self.data) | [
"def",
"save",
"(",
"self",
",",
"path",
")",
":",
"with",
"open",
"(",
"path",
",",
"'wb'",
")",
"as",
"f",
":",
"f",
".",
"write",
"(",
"self",
".",
"data",
")"
] | Save report to XML file. | [
"Save",
"report",
"to",
"XML",
"file",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/flexreport.py#L124-L129 | train | Save report to XML file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/contract.py | Contract.create | def create(**kwargs):
"""
Create and a return a specialized contract based on the given secType,
or a general Contract if secType is not given.
"""
secType = kwargs.get('secType', '')
cls = {
'': Contract,
'STK': Stock,
'OPT': Option,
... | python | def create(**kwargs):
"""
Create and a return a specialized contract based on the given secType,
or a general Contract if secType is not given.
"""
secType = kwargs.get('secType', '')
cls = {
'': Contract,
'STK': Stock,
'OPT': Option,
... | [
"def",
"create",
"(",
"*",
"*",
"kwargs",
")",
":",
"secType",
"=",
"kwargs",
".",
"get",
"(",
"'secType'",
",",
"''",
")",
"cls",
"=",
"{",
"''",
":",
"Contract",
",",
"'STK'",
":",
"Stock",
",",
"'OPT'",
":",
"Option",
",",
"'FUT'",
":",
"Futur... | Create and a return a specialized contract based on the given secType,
or a general Contract if secType is not given. | [
"Create",
"and",
"a",
"return",
"a",
"specialized",
"contract",
"based",
"on",
"the",
"given",
"secType",
"or",
"a",
"general",
"Contract",
"if",
"secType",
"is",
"not",
"given",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/contract.py#L102-L128 | train | Create and a return a specialized contract based on the given secType. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ticker.py | Ticker.hasBidAsk | def hasBidAsk(self) -> bool:
"""
See if this ticker has a valid bid and ask.
"""
return (
self.bid != -1 and not isNan(self.bid) and self.bidSize > 0 and
self.ask != -1 and not isNan(self.ask) and self.askSize > 0) | python | def hasBidAsk(self) -> bool:
"""
See if this ticker has a valid bid and ask.
"""
return (
self.bid != -1 and not isNan(self.bid) and self.bidSize > 0 and
self.ask != -1 and not isNan(self.ask) and self.askSize > 0) | [
"def",
"hasBidAsk",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"(",
"self",
".",
"bid",
"!=",
"-",
"1",
"and",
"not",
"isNan",
"(",
"self",
".",
"bid",
")",
"and",
"self",
".",
"bidSize",
">",
"0",
"and",
"self",
".",
"ask",
"!=",
"-",
"1",... | See if this ticker has a valid bid and ask. | [
"See",
"if",
"this",
"ticker",
"has",
"a",
"valid",
"bid",
"and",
"ask",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ticker.py#L107-L113 | train | See if this ticker has a valid bid and ask. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ticker.py | Ticker.midpoint | def midpoint(self) -> float:
"""
Return average of bid and ask, or NaN if no valid bid and ask
are available.
"""
return (self.bid + self.ask) / 2 if self.hasBidAsk() else nan | python | def midpoint(self) -> float:
"""
Return average of bid and ask, or NaN if no valid bid and ask
are available.
"""
return (self.bid + self.ask) / 2 if self.hasBidAsk() else nan | [
"def",
"midpoint",
"(",
"self",
")",
"->",
"float",
":",
"return",
"(",
"self",
".",
"bid",
"+",
"self",
".",
"ask",
")",
"/",
"2",
"if",
"self",
".",
"hasBidAsk",
"(",
")",
"else",
"nan"
] | Return average of bid and ask, or NaN if no valid bid and ask
are available. | [
"Return",
"average",
"of",
"bid",
"and",
"ask",
"or",
"NaN",
"if",
"no",
"valid",
"bid",
"and",
"ask",
"are",
"available",
"."
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ticker.py#L115-L120 | train | Return the midpoint of the current session. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
erdewit/ib_insync | ib_insync/ticker.py | Ticker.marketPrice | def marketPrice(self) -> float:
"""
Return the first available one of
* last price if within current bid/ask;
* average of bid and ask (midpoint);
* close price.
"""
price = self.last if (
self.hasBidAsk() and self.bid <= self.last <= self.ask) else \... | python | def marketPrice(self) -> float:
"""
Return the first available one of
* last price if within current bid/ask;
* average of bid and ask (midpoint);
* close price.
"""
price = self.last if (
self.hasBidAsk() and self.bid <= self.last <= self.ask) else \... | [
"def",
"marketPrice",
"(",
"self",
")",
"->",
"float",
":",
"price",
"=",
"self",
".",
"last",
"if",
"(",
"self",
".",
"hasBidAsk",
"(",
")",
"and",
"self",
".",
"bid",
"<=",
"self",
".",
"last",
"<=",
"self",
".",
"ask",
")",
"else",
"self",
"."... | Return the first available one of
* last price if within current bid/ask;
* average of bid and ask (midpoint);
* close price. | [
"Return",
"the",
"first",
"available",
"one",
"of"
] | d0646a482590f5cb7bfddbd1f0870f8c4bc1df80 | https://github.com/erdewit/ib_insync/blob/d0646a482590f5cb7bfddbd1f0870f8c4bc1df80/ib_insync/ticker.py#L122-L135 | train | Return the first available one of the current order and the last price if within current bid and ask. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
vi3k6i5/flashtext | flashtext/keyword.py | KeywordProcessor.add_keyword_from_file | def add_keyword_from_file(self, keyword_file, encoding="utf-8"):
"""To add keywords from a file
Args:
keyword_file : path to keywords file
encoding : specify the encoding of the file
Examples:
keywords file format can be like:
>>> # Option 1: ke... | python | def add_keyword_from_file(self, keyword_file, encoding="utf-8"):
"""To add keywords from a file
Args:
keyword_file : path to keywords file
encoding : specify the encoding of the file
Examples:
keywords file format can be like:
>>> # Option 1: ke... | [
"def",
"add_keyword_from_file",
"(",
"self",
",",
"keyword_file",
",",
"encoding",
"=",
"\"utf-8\"",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"keyword_file",
")",
":",
"raise",
"IOError",
"(",
"\"Invalid file path {}\"",
".",
"format",
"... | To add keywords from a file
Args:
keyword_file : path to keywords file
encoding : specify the encoding of the file
Examples:
keywords file format can be like:
>>> # Option 1: keywords.txt content
>>> # java_2e=>java
>>> # java pr... | [
"To",
"add",
"keywords",
"from",
"a",
"file"
] | 50c45f1f4a394572381249681046f57e2bf5a591 | https://github.com/vi3k6i5/flashtext/blob/50c45f1f4a394572381249681046f57e2bf5a591/flashtext/keyword.py#L291-L327 | train | To add keywords from a file in the current language | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
vi3k6i5/flashtext | flashtext/keyword.py | KeywordProcessor.add_keywords_from_dict | def add_keywords_from_dict(self, keyword_dict):
"""To add keywords from a dictionary
Args:
keyword_dict (dict): A dictionary with `str` key and (list `str`) as value
Examples:
>>> keyword_dict = {
"java": ["java_2e", "java programing"],
... | python | def add_keywords_from_dict(self, keyword_dict):
"""To add keywords from a dictionary
Args:
keyword_dict (dict): A dictionary with `str` key and (list `str`) as value
Examples:
>>> keyword_dict = {
"java": ["java_2e", "java programing"],
... | [
"def",
"add_keywords_from_dict",
"(",
"self",
",",
"keyword_dict",
")",
":",
"for",
"clean_name",
",",
"keywords",
"in",
"keyword_dict",
".",
"items",
"(",
")",
":",
"if",
"not",
"isinstance",
"(",
"keywords",
",",
"list",
")",
":",
"raise",
"AttributeError"... | To add keywords from a dictionary
Args:
keyword_dict (dict): A dictionary with `str` key and (list `str`) as value
Examples:
>>> keyword_dict = {
"java": ["java_2e", "java programing"],
"product management": ["PM", "product manager"]
... | [
"To",
"add",
"keywords",
"from",
"a",
"dictionary"
] | 50c45f1f4a394572381249681046f57e2bf5a591 | https://github.com/vi3k6i5/flashtext/blob/50c45f1f4a394572381249681046f57e2bf5a591/flashtext/keyword.py#L329-L351 | train | To add keywords from a dictionary. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
vi3k6i5/flashtext | flashtext/keyword.py | KeywordProcessor.remove_keywords_from_dict | def remove_keywords_from_dict(self, keyword_dict):
"""To remove keywords from a dictionary
Args:
keyword_dict (dict): A dictionary with `str` key and (list `str`) as value
Examples:
>>> keyword_dict = {
"java": ["java_2e", "java programing"],
... | python | def remove_keywords_from_dict(self, keyword_dict):
"""To remove keywords from a dictionary
Args:
keyword_dict (dict): A dictionary with `str` key and (list `str`) as value
Examples:
>>> keyword_dict = {
"java": ["java_2e", "java programing"],
... | [
"def",
"remove_keywords_from_dict",
"(",
"self",
",",
"keyword_dict",
")",
":",
"for",
"clean_name",
",",
"keywords",
"in",
"keyword_dict",
".",
"items",
"(",
")",
":",
"if",
"not",
"isinstance",
"(",
"keywords",
",",
"list",
")",
":",
"raise",
"AttributeErr... | To remove keywords from a dictionary
Args:
keyword_dict (dict): A dictionary with `str` key and (list `str`) as value
Examples:
>>> keyword_dict = {
"java": ["java_2e", "java programing"],
"product management": ["PM", "product manager"]
... | [
"To",
"remove",
"keywords",
"from",
"a",
"dictionary"
] | 50c45f1f4a394572381249681046f57e2bf5a591 | https://github.com/vi3k6i5/flashtext/blob/50c45f1f4a394572381249681046f57e2bf5a591/flashtext/keyword.py#L353-L375 | train | To remove keywords from a dictionary | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
vi3k6i5/flashtext | flashtext/keyword.py | KeywordProcessor.add_keywords_from_list | def add_keywords_from_list(self, keyword_list):
"""To add keywords from a list
Args:
keyword_list (list(str)): List of keywords to add
Examples:
>>> keyword_processor.add_keywords_from_list(["java", "python"]})
Raises:
AttributeError: If `keyword_lis... | python | def add_keywords_from_list(self, keyword_list):
"""To add keywords from a list
Args:
keyword_list (list(str)): List of keywords to add
Examples:
>>> keyword_processor.add_keywords_from_list(["java", "python"]})
Raises:
AttributeError: If `keyword_lis... | [
"def",
"add_keywords_from_list",
"(",
"self",
",",
"keyword_list",
")",
":",
"if",
"not",
"isinstance",
"(",
"keyword_list",
",",
"list",
")",
":",
"raise",
"AttributeError",
"(",
"\"keyword_list should be a list\"",
")",
"for",
"keyword",
"in",
"keyword_list",
":... | To add keywords from a list
Args:
keyword_list (list(str)): List of keywords to add
Examples:
>>> keyword_processor.add_keywords_from_list(["java", "python"]})
Raises:
AttributeError: If `keyword_list` is not a list. | [
"To",
"add",
"keywords",
"from",
"a",
"list"
] | 50c45f1f4a394572381249681046f57e2bf5a591 | https://github.com/vi3k6i5/flashtext/blob/50c45f1f4a394572381249681046f57e2bf5a591/flashtext/keyword.py#L377-L393 | train | To add keywords from a list of keywords to the current object | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
vi3k6i5/flashtext | flashtext/keyword.py | KeywordProcessor.remove_keywords_from_list | def remove_keywords_from_list(self, keyword_list):
"""To remove keywords present in list
Args:
keyword_list (list(str)): List of keywords to remove
Examples:
>>> keyword_processor.remove_keywords_from_list(["java", "python"]})
Raises:
AttributeError:... | python | def remove_keywords_from_list(self, keyword_list):
"""To remove keywords present in list
Args:
keyword_list (list(str)): List of keywords to remove
Examples:
>>> keyword_processor.remove_keywords_from_list(["java", "python"]})
Raises:
AttributeError:... | [
"def",
"remove_keywords_from_list",
"(",
"self",
",",
"keyword_list",
")",
":",
"if",
"not",
"isinstance",
"(",
"keyword_list",
",",
"list",
")",
":",
"raise",
"AttributeError",
"(",
"\"keyword_list should be a list\"",
")",
"for",
"keyword",
"in",
"keyword_list",
... | To remove keywords present in list
Args:
keyword_list (list(str)): List of keywords to remove
Examples:
>>> keyword_processor.remove_keywords_from_list(["java", "python"]})
Raises:
AttributeError: If `keyword_list` is not a list. | [
"To",
"remove",
"keywords",
"present",
"in",
"list"
] | 50c45f1f4a394572381249681046f57e2bf5a591 | https://github.com/vi3k6i5/flashtext/blob/50c45f1f4a394572381249681046f57e2bf5a591/flashtext/keyword.py#L395-L411 | train | To remove keywords present in list
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
vi3k6i5/flashtext | flashtext/keyword.py | KeywordProcessor.get_all_keywords | def get_all_keywords(self, term_so_far='', current_dict=None):
"""Recursively builds a dictionary of keywords present in the dictionary
And the clean name mapped to those keywords.
Args:
term_so_far : string
term built so far by adding all previous characters
... | python | def get_all_keywords(self, term_so_far='', current_dict=None):
"""Recursively builds a dictionary of keywords present in the dictionary
And the clean name mapped to those keywords.
Args:
term_so_far : string
term built so far by adding all previous characters
... | [
"def",
"get_all_keywords",
"(",
"self",
",",
"term_so_far",
"=",
"''",
",",
"current_dict",
"=",
"None",
")",
":",
"terms_present",
"=",
"{",
"}",
"if",
"not",
"term_so_far",
":",
"term_so_far",
"=",
"''",
"if",
"current_dict",
"is",
"None",
":",
"current_... | Recursively builds a dictionary of keywords present in the dictionary
And the clean name mapped to those keywords.
Args:
term_so_far : string
term built so far by adding all previous characters
current_dict : dict
current recursive position in dic... | [
"Recursively",
"builds",
"a",
"dictionary",
"of",
"keywords",
"present",
"in",
"the",
"dictionary",
"And",
"the",
"clean",
"name",
"mapped",
"to",
"those",
"keywords",
"."
] | 50c45f1f4a394572381249681046f57e2bf5a591 | https://github.com/vi3k6i5/flashtext/blob/50c45f1f4a394572381249681046f57e2bf5a591/flashtext/keyword.py#L413-L448 | train | Recursively builds a dictionary of keywords present in the keyword trie and returns the clean name mapped to those keywords. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
vi3k6i5/flashtext | flashtext/keyword.py | KeywordProcessor.extract_keywords | def extract_keywords(self, sentence, span_info=False):
"""Searches in the string for all keywords present in corpus.
Keywords present are added to a list `keywords_extracted` and returned.
Args:
sentence (str): Line of text where we will search for keywords
Returns:
... | python | def extract_keywords(self, sentence, span_info=False):
"""Searches in the string for all keywords present in corpus.
Keywords present are added to a list `keywords_extracted` and returned.
Args:
sentence (str): Line of text where we will search for keywords
Returns:
... | [
"def",
"extract_keywords",
"(",
"self",
",",
"sentence",
",",
"span_info",
"=",
"False",
")",
":",
"keywords_extracted",
"=",
"[",
"]",
"if",
"not",
"sentence",
":",
"# if sentence is empty or none just return empty list",
"return",
"keywords_extracted",
"if",
"not",
... | Searches in the string for all keywords present in corpus.
Keywords present are added to a list `keywords_extracted` and returned.
Args:
sentence (str): Line of text where we will search for keywords
Returns:
keywords_extracted (list(str)): List of terms/keywords found ... | [
"Searches",
"in",
"the",
"string",
"for",
"all",
"keywords",
"present",
"in",
"corpus",
".",
"Keywords",
"present",
"are",
"added",
"to",
"a",
"list",
"keywords_extracted",
"and",
"returned",
"."
] | 50c45f1f4a394572381249681046f57e2bf5a591 | https://github.com/vi3k6i5/flashtext/blob/50c45f1f4a394572381249681046f57e2bf5a591/flashtext/keyword.py#L450-L558 | train | Searches in the string for all keywords present in corpus and returns a list of lists of all keywords present in the corpus. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
vi3k6i5/flashtext | flashtext/keyword.py | KeywordProcessor.replace_keywords | def replace_keywords(self, sentence):
"""Searches in the string for all keywords present in corpus.
Keywords present are replaced by the clean name and a new string is returned.
Args:
sentence (str): Line of text where we will replace keywords
Returns:
new_sente... | python | def replace_keywords(self, sentence):
"""Searches in the string for all keywords present in corpus.
Keywords present are replaced by the clean name and a new string is returned.
Args:
sentence (str): Line of text where we will replace keywords
Returns:
new_sente... | [
"def",
"replace_keywords",
"(",
"self",
",",
"sentence",
")",
":",
"if",
"not",
"sentence",
":",
"# if sentence is empty or none just return the same.",
"return",
"sentence",
"new_sentence",
"=",
"[",
"]",
"orig_sentence",
"=",
"sentence",
"if",
"not",
"self",
".",
... | Searches in the string for all keywords present in corpus.
Keywords present are replaced by the clean name and a new string is returned.
Args:
sentence (str): Line of text where we will replace keywords
Returns:
new_sentence (str): Line of text with replaced keywords
... | [
"Searches",
"in",
"the",
"string",
"for",
"all",
"keywords",
"present",
"in",
"corpus",
".",
"Keywords",
"present",
"are",
"replaced",
"by",
"the",
"clean",
"name",
"and",
"a",
"new",
"string",
"is",
"returned",
"."
] | 50c45f1f4a394572381249681046f57e2bf5a591 | https://github.com/vi3k6i5/flashtext/blob/50c45f1f4a394572381249681046f57e2bf5a591/flashtext/keyword.py#L560-L681 | train | Searches in the string for all keywords present in corpus and replaces them with the clean name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | factor_information_coefficient | def factor_information_coefficient(factor_data,
group_adjust=False,
by_group=False):
"""
Computes the Spearman Rank Correlation based Information Coefficient (IC)
between factor values and N period forward returns for each period in
t... | python | def factor_information_coefficient(factor_data,
group_adjust=False,
by_group=False):
"""
Computes the Spearman Rank Correlation based Information Coefficient (IC)
between factor values and N period forward returns for each period in
t... | [
"def",
"factor_information_coefficient",
"(",
"factor_data",
",",
"group_adjust",
"=",
"False",
",",
"by_group",
"=",
"False",
")",
":",
"def",
"src_ic",
"(",
"group",
")",
":",
"f",
"=",
"group",
"[",
"'factor'",
"]",
"_ic",
"=",
"group",
"[",
"utils",
... | Computes the Spearman Rank Correlation based Information Coefficient (IC)
between factor values and N period forward returns for each period in
the factor index.
Parameters
----------
factor_data : pd.DataFrame - MultiIndex
A MultiIndex DataFrame indexed by date (level 0) and asset (level 1... | [
"Computes",
"the",
"Spearman",
"Rank",
"Correlation",
"based",
"Information",
"Coefficient",
"(",
"IC",
")",
"between",
"factor",
"values",
"and",
"N",
"period",
"forward",
"returns",
"for",
"each",
"period",
"in",
"the",
"factor",
"index",
"."
] | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L27-L73 | train | Computes the Spearman Rank Correlation based Information Coefficient between factor values and N period forward returns for each group. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | mean_information_coefficient | def mean_information_coefficient(factor_data,
group_adjust=False,
by_group=False,
by_time=None):
"""
Get the mean information coefficient of specified groups.
Answers questions like:
What is the mean IC fo... | python | def mean_information_coefficient(factor_data,
group_adjust=False,
by_group=False,
by_time=None):
"""
Get the mean information coefficient of specified groups.
Answers questions like:
What is the mean IC fo... | [
"def",
"mean_information_coefficient",
"(",
"factor_data",
",",
"group_adjust",
"=",
"False",
",",
"by_group",
"=",
"False",
",",
"by_time",
"=",
"None",
")",
":",
"ic",
"=",
"factor_information_coefficient",
"(",
"factor_data",
",",
"group_adjust",
",",
"by_group... | Get the mean information coefficient of specified groups.
Answers questions like:
What is the mean IC for each month?
What is the mean IC for each group for our whole timerange?
What is the mean IC for for each group, each week?
Parameters
----------
factor_data : pd.DataFrame - MultiIndex
... | [
"Get",
"the",
"mean",
"information",
"coefficient",
"of",
"specified",
"groups",
".",
"Answers",
"questions",
"like",
":",
"What",
"is",
"the",
"mean",
"IC",
"for",
"each",
"month?",
"What",
"is",
"the",
"mean",
"IC",
"for",
"each",
"group",
"for",
"our",
... | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L76-L125 | train | Calculates the mean information coefficient between two groups of the same type. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | factor_weights | def factor_weights(factor_data,
demeaned=True,
group_adjust=False,
equal_weight=False):
"""
Computes asset weights by factor values and dividing by the sum of their
absolute value (achieving gross leverage of 1). Positive factor values will
result... | python | def factor_weights(factor_data,
demeaned=True,
group_adjust=False,
equal_weight=False):
"""
Computes asset weights by factor values and dividing by the sum of their
absolute value (achieving gross leverage of 1). Positive factor values will
result... | [
"def",
"factor_weights",
"(",
"factor_data",
",",
"demeaned",
"=",
"True",
",",
"group_adjust",
"=",
"False",
",",
"equal_weight",
"=",
"False",
")",
":",
"def",
"to_weights",
"(",
"group",
",",
"_demeaned",
",",
"_equal_weight",
")",
":",
"if",
"_equal_weig... | Computes asset weights by factor values and dividing by the sum of their
absolute value (achieving gross leverage of 1). Positive factor values will
results in positive weights and negative values in negative weights.
Parameters
----------
factor_data : pd.DataFrame - MultiIndex
A MultiInde... | [
"Computes",
"asset",
"weights",
"by",
"factor",
"values",
"and",
"dividing",
"by",
"the",
"sum",
"of",
"their",
"absolute",
"value",
"(",
"achieving",
"gross",
"leverage",
"of",
"1",
")",
".",
"Positive",
"factor",
"values",
"will",
"results",
"in",
"positiv... | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L128-L204 | train | Computes the asset weights for a single alpha factor and forward returns for a single group neutral portfolio. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | factor_returns | def factor_returns(factor_data,
demeaned=True,
group_adjust=False,
equal_weight=False,
by_asset=False):
"""
Computes period wise returns for portfolio weighted by factor
values.
Parameters
----------
factor_data : pd.Da... | python | def factor_returns(factor_data,
demeaned=True,
group_adjust=False,
equal_weight=False,
by_asset=False):
"""
Computes period wise returns for portfolio weighted by factor
values.
Parameters
----------
factor_data : pd.Da... | [
"def",
"factor_returns",
"(",
"factor_data",
",",
"demeaned",
"=",
"True",
",",
"group_adjust",
"=",
"False",
",",
"equal_weight",
"=",
"False",
",",
"by_asset",
"=",
"False",
")",
":",
"weights",
"=",
"factor_weights",
"(",
"factor_data",
",",
"demeaned",
"... | Computes period wise returns for portfolio weighted by factor
values.
Parameters
----------
factor_data : pd.DataFrame - MultiIndex
A MultiIndex DataFrame indexed by date (level 0) and asset (level 1),
containing the values for a single alpha factor, forward returns for
each per... | [
"Computes",
"period",
"wise",
"returns",
"for",
"portfolio",
"weighted",
"by",
"factor",
"values",
"."
] | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L207-L254 | train | Returns a DataFrame containing the period wise factor returns for a single alpha factor and a factor value for each period. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | factor_alpha_beta | def factor_alpha_beta(factor_data,
returns=None,
demeaned=True,
group_adjust=False,
equal_weight=False):
"""
Compute the alpha (excess returns), alpha t-stat (alpha significance),
and beta (market exposure) of a factor. ... | python | def factor_alpha_beta(factor_data,
returns=None,
demeaned=True,
group_adjust=False,
equal_weight=False):
"""
Compute the alpha (excess returns), alpha t-stat (alpha significance),
and beta (market exposure) of a factor. ... | [
"def",
"factor_alpha_beta",
"(",
"factor_data",
",",
"returns",
"=",
"None",
",",
"demeaned",
"=",
"True",
",",
"group_adjust",
"=",
"False",
",",
"equal_weight",
"=",
"False",
")",
":",
"if",
"returns",
"is",
"None",
":",
"returns",
"=",
"factor_returns",
... | Compute the alpha (excess returns), alpha t-stat (alpha significance),
and beta (market exposure) of a factor. A regression is run with
the period wise factor universe mean return as the independent variable
and mean period wise return from a portfolio weighted by factor values
as the dependent variable... | [
"Compute",
"the",
"alpha",
"(",
"excess",
"returns",
")",
"alpha",
"t",
"-",
"stat",
"(",
"alpha",
"significance",
")",
"and",
"beta",
"(",
"market",
"exposure",
")",
"of",
"a",
"factor",
".",
"A",
"regression",
"is",
"run",
"with",
"the",
"period",
"w... | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L257-L329 | train | Compute the alpha beta for a given factor and returns. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | cumulative_returns | def cumulative_returns(returns, period, freq=None):
"""
Builds cumulative returns from 'period' returns. This function simulates
the cumulative effect that a series of gains or losses (the 'returns')
have on an original amount of capital over a period of time.
if F is the frequency at which returns... | python | def cumulative_returns(returns, period, freq=None):
"""
Builds cumulative returns from 'period' returns. This function simulates
the cumulative effect that a series of gains or losses (the 'returns')
have on an original amount of capital over a period of time.
if F is the frequency at which returns... | [
"def",
"cumulative_returns",
"(",
"returns",
",",
"period",
",",
"freq",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"period",
",",
"pd",
".",
"Timedelta",
")",
":",
"period",
"=",
"pd",
".",
"Timedelta",
"(",
"period",
")",
"if",
"freq",
... | Builds cumulative returns from 'period' returns. This function simulates
the cumulative effect that a series of gains or losses (the 'returns')
have on an original amount of capital over a period of time.
if F is the frequency at which returns are computed (e.g. 1 day if
'returns' contains daily values... | [
"Builds",
"cumulative",
"returns",
"from",
"period",
"returns",
".",
"This",
"function",
"simulates",
"the",
"cumulative",
"effect",
"that",
"a",
"series",
"of",
"gains",
"or",
"losses",
"(",
"the",
"returns",
")",
"have",
"on",
"an",
"original",
"amount",
"... | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L332-L494 | train | Builds the cumulative returns from the given period returns. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | positions | def positions(weights, period, freq=None):
"""
Builds net position values time series, the portfolio percentage invested
in each position.
Parameters
----------
weights: pd.Series
pd.Series containing factor weights, the index contains timestamps at
which the trades are computed... | python | def positions(weights, period, freq=None):
"""
Builds net position values time series, the portfolio percentage invested
in each position.
Parameters
----------
weights: pd.Series
pd.Series containing factor weights, the index contains timestamps at
which the trades are computed... | [
"def",
"positions",
"(",
"weights",
",",
"period",
",",
"freq",
"=",
"None",
")",
":",
"weights",
"=",
"weights",
".",
"unstack",
"(",
")",
"if",
"not",
"isinstance",
"(",
"period",
",",
"pd",
".",
"Timedelta",
")",
":",
"period",
"=",
"pd",
".",
"... | Builds net position values time series, the portfolio percentage invested
in each position.
Parameters
----------
weights: pd.Series
pd.Series containing factor weights, the index contains timestamps at
which the trades are computed and the values correspond to assets
weights
... | [
"Builds",
"net",
"position",
"values",
"time",
"series",
"the",
"portfolio",
"percentage",
"invested",
"in",
"each",
"position",
"."
] | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L497-L592 | train | Builds net position values time series for each asset in the next position. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | mean_return_by_quantile | def mean_return_by_quantile(factor_data,
by_date=False,
by_group=False,
demeaned=True,
group_adjust=False):
"""
Computes mean returns for factor quantiles across
provided forward returns columns.
... | python | def mean_return_by_quantile(factor_data,
by_date=False,
by_group=False,
demeaned=True,
group_adjust=False):
"""
Computes mean returns for factor quantiles across
provided forward returns columns.
... | [
"def",
"mean_return_by_quantile",
"(",
"factor_data",
",",
"by_date",
"=",
"False",
",",
"by_group",
"=",
"False",
",",
"demeaned",
"=",
"True",
",",
"group_adjust",
"=",
"False",
")",
":",
"if",
"group_adjust",
":",
"grouper",
"=",
"[",
"factor_data",
".",
... | Computes mean returns for factor quantiles across
provided forward returns columns.
Parameters
----------
factor_data : pd.DataFrame - MultiIndex
A MultiIndex DataFrame indexed by date (level 0) and asset (level 1),
containing the values for a single alpha factor, forward returns for
... | [
"Computes",
"mean",
"returns",
"for",
"factor",
"quantiles",
"across",
"provided",
"forward",
"returns",
"columns",
"."
] | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L595-L659 | train | Compute mean returns for a single alpha factor and a single group of returns. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | compute_mean_returns_spread | def compute_mean_returns_spread(mean_returns,
upper_quant,
lower_quant,
std_err=None):
"""
Computes the difference between the mean returns of
two quantiles. Optionally, computes the standard error
of this di... | python | def compute_mean_returns_spread(mean_returns,
upper_quant,
lower_quant,
std_err=None):
"""
Computes the difference between the mean returns of
two quantiles. Optionally, computes the standard error
of this di... | [
"def",
"compute_mean_returns_spread",
"(",
"mean_returns",
",",
"upper_quant",
",",
"lower_quant",
",",
"std_err",
"=",
"None",
")",
":",
"mean_return_difference",
"=",
"mean_returns",
".",
"xs",
"(",
"upper_quant",
",",
"level",
"=",
"'factor_quantile'",
")",
"-"... | Computes the difference between the mean returns of
two quantiles. Optionally, computes the standard error
of this difference.
Parameters
----------
mean_returns : pd.DataFrame
DataFrame of mean period wise returns by quantile.
MultiIndex containing date and quantile.
See me... | [
"Computes",
"the",
"difference",
"between",
"the",
"mean",
"returns",
"of",
"two",
"quantiles",
".",
"Optionally",
"computes",
"the",
"standard",
"error",
"of",
"this",
"difference",
"."
] | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L662-L707 | train | Computes the difference between the mean returns of the current weather and the standard error of the two quantiles. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | quantile_turnover | def quantile_turnover(quantile_factor, quantile, period=1):
"""
Computes the proportion of names in a factor quantile that were
not in that quantile in the previous period.
Parameters
----------
quantile_factor : pd.Series
DataFrame with date, asset and factor quantile.
quantile : i... | python | def quantile_turnover(quantile_factor, quantile, period=1):
"""
Computes the proportion of names in a factor quantile that were
not in that quantile in the previous period.
Parameters
----------
quantile_factor : pd.Series
DataFrame with date, asset and factor quantile.
quantile : i... | [
"def",
"quantile_turnover",
"(",
"quantile_factor",
",",
"quantile",
",",
"period",
"=",
"1",
")",
":",
"quant_names",
"=",
"quantile_factor",
"[",
"quantile_factor",
"==",
"quantile",
"]",
"quant_name_sets",
"=",
"quant_names",
".",
"groupby",
"(",
"level",
"="... | Computes the proportion of names in a factor quantile that were
not in that quantile in the previous period.
Parameters
----------
quantile_factor : pd.Series
DataFrame with date, asset and factor quantile.
quantile : int
Quantile on which to perform turnover analysis.
period: s... | [
"Computes",
"the",
"proportion",
"of",
"names",
"in",
"a",
"factor",
"quantile",
"that",
"were",
"not",
"in",
"that",
"quantile",
"in",
"the",
"previous",
"period",
"."
] | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L710-L748 | train | Computes the proportion of names in a factor quantile that were not in that quantile in the previous period. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | factor_rank_autocorrelation | def factor_rank_autocorrelation(factor_data, period=1):
"""
Computes autocorrelation of mean factor ranks in specified time spans.
We must compare period to period factor ranks rather than factor values
to account for systematic shifts in the factor values of all names or names
within a group. This ... | python | def factor_rank_autocorrelation(factor_data, period=1):
"""
Computes autocorrelation of mean factor ranks in specified time spans.
We must compare period to period factor ranks rather than factor values
to account for systematic shifts in the factor values of all names or names
within a group. This ... | [
"def",
"factor_rank_autocorrelation",
"(",
"factor_data",
",",
"period",
"=",
"1",
")",
":",
"grouper",
"=",
"[",
"factor_data",
".",
"index",
".",
"get_level_values",
"(",
"'date'",
")",
"]",
"ranks",
"=",
"factor_data",
".",
"groupby",
"(",
"grouper",
")",... | Computes autocorrelation of mean factor ranks in specified time spans.
We must compare period to period factor ranks rather than factor values
to account for systematic shifts in the factor values of all names or names
within a group. This metric is useful for measuring the turnover of a
factor. If the ... | [
"Computes",
"autocorrelation",
"of",
"mean",
"factor",
"ranks",
"in",
"specified",
"time",
"spans",
".",
"We",
"must",
"compare",
"period",
"to",
"period",
"factor",
"ranks",
"rather",
"than",
"factor",
"values",
"to",
"account",
"for",
"systematic",
"shifts",
... | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L751-L799 | train | Calculates autocorrelation of factor values in specified time spans. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | common_start_returns | def common_start_returns(factor,
prices,
before,
after,
cumulative=False,
mean_by_date=False,
demean_by=None):
"""
A date and equity pair is extracted from each i... | python | def common_start_returns(factor,
prices,
before,
after,
cumulative=False,
mean_by_date=False,
demean_by=None):
"""
A date and equity pair is extracted from each i... | [
"def",
"common_start_returns",
"(",
"factor",
",",
"prices",
",",
"before",
",",
"after",
",",
"cumulative",
"=",
"False",
",",
"mean_by_date",
"=",
"False",
",",
"demean_by",
"=",
"None",
")",
":",
"if",
"cumulative",
":",
"returns",
"=",
"prices",
"else"... | A date and equity pair is extracted from each index row in the factor
dataframe and for each of these pairs a return series is built starting
from 'before' the date and ending 'after' the date specified in the pair.
All those returns series are then aligned to a common index (-before to
after) and retur... | [
"A",
"date",
"and",
"equity",
"pair",
"is",
"extracted",
"from",
"each",
"index",
"row",
"in",
"the",
"factor",
"dataframe",
"and",
"for",
"each",
"of",
"these",
"pairs",
"a",
"return",
"series",
"is",
"built",
"starting",
"from",
"before",
"the",
"date",
... | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L802-L892 | train | This function returns a series of common start returns for a factor and a set of prices and returns for each date. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | average_cumulative_return_by_quantile | def average_cumulative_return_by_quantile(factor_data,
prices,
periods_before=10,
periods_after=15,
demeaned=True,
... | python | def average_cumulative_return_by_quantile(factor_data,
prices,
periods_before=10,
periods_after=15,
demeaned=True,
... | [
"def",
"average_cumulative_return_by_quantile",
"(",
"factor_data",
",",
"prices",
",",
"periods_before",
"=",
"10",
",",
"periods_after",
"=",
"15",
",",
"demeaned",
"=",
"True",
",",
"group_adjust",
"=",
"False",
",",
"by_group",
"=",
"False",
")",
":",
"def... | Plots average cumulative returns by factor quantiles in the period range
defined by -periods_before to periods_after
Parameters
----------
factor_data : pd.DataFrame - MultiIndex
A MultiIndex DataFrame indexed by date (level 0) and asset (level 1),
containing the values for a single alp... | [
"Plots",
"average",
"cumulative",
"returns",
"by",
"factor",
"quantiles",
"in",
"the",
"period",
"range",
"defined",
"by",
"-",
"periods_before",
"to",
"periods_after"
] | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L895-L1018 | train | Calculates the average cumulative returns for a single factor and a forward factor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | factor_cumulative_returns | def factor_cumulative_returns(factor_data,
period,
long_short=True,
group_neutral=False,
equal_weight=False,
quantiles=None,
groups=None):
... | python | def factor_cumulative_returns(factor_data,
period,
long_short=True,
group_neutral=False,
equal_weight=False,
quantiles=None,
groups=None):
... | [
"def",
"factor_cumulative_returns",
"(",
"factor_data",
",",
"period",
",",
"long_short",
"=",
"True",
",",
"group_neutral",
"=",
"False",
",",
"equal_weight",
"=",
"False",
",",
"quantiles",
"=",
"None",
",",
"groups",
"=",
"None",
")",
":",
"fwd_ret_cols",
... | Simulate a portfolio using the factor in input and returns the cumulative
returns of the simulated portfolio
Parameters
----------
factor_data : pd.DataFrame - MultiIndex
A MultiIndex DataFrame indexed by date (level 0) and asset (level 1),
containing the values for a single alpha facto... | [
"Simulate",
"a",
"portfolio",
"using",
"the",
"factor",
"in",
"input",
"and",
"returns",
"the",
"cumulative",
"returns",
"of",
"the",
"simulated",
"portfolio"
] | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L1021-L1088 | train | Simulate a portfolio using a factor in input and returns the cumulative returns of the simulated portfolio. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | factor_positions | def factor_positions(factor_data,
period,
long_short=True,
group_neutral=False,
equal_weight=False,
quantiles=None,
groups=None):
"""
Simulate a portfolio using the factor in input and r... | python | def factor_positions(factor_data,
period,
long_short=True,
group_neutral=False,
equal_weight=False,
quantiles=None,
groups=None):
"""
Simulate a portfolio using the factor in input and r... | [
"def",
"factor_positions",
"(",
"factor_data",
",",
"period",
",",
"long_short",
"=",
"True",
",",
"group_neutral",
"=",
"False",
",",
"equal_weight",
"=",
"False",
",",
"quantiles",
"=",
"None",
",",
"groups",
"=",
"None",
")",
":",
"fwd_ret_cols",
"=",
"... | Simulate a portfolio using the factor in input and returns the assets
positions as percentage of the total portfolio.
Parameters
----------
factor_data : pd.DataFrame - MultiIndex
A MultiIndex DataFrame indexed by date (level 0) and asset (level 1),
containing the values for a single al... | [
"Simulate",
"a",
"portfolio",
"using",
"the",
"factor",
"in",
"input",
"and",
"returns",
"the",
"assets",
"positions",
"as",
"percentage",
"of",
"the",
"total",
"portfolio",
"."
] | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L1091-L1160 | train | Simulate a portfolio using a factor in input and returns the assets positions as percentage of the total portfolio. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/performance.py | create_pyfolio_input | def create_pyfolio_input(factor_data,
period,
capital=None,
long_short=True,
group_neutral=False,
equal_weight=False,
quantiles=None,
groups=None... | python | def create_pyfolio_input(factor_data,
period,
capital=None,
long_short=True,
group_neutral=False,
equal_weight=False,
quantiles=None,
groups=None... | [
"def",
"create_pyfolio_input",
"(",
"factor_data",
",",
"period",
",",
"capital",
"=",
"None",
",",
"long_short",
"=",
"True",
",",
"group_neutral",
"=",
"False",
",",
"equal_weight",
"=",
"False",
",",
"quantiles",
"=",
"None",
",",
"groups",
"=",
"None",
... | Simulate a portfolio using the input factor and returns the portfolio
performance data properly formatted for Pyfolio analysis.
For more details on how this portfolio is built see:
- performance.cumulative_returns (how the portfolio returns are computed)
- performance.factor_weights (how assets weights... | [
"Simulate",
"a",
"portfolio",
"using",
"the",
"input",
"factor",
"and",
"returns",
"the",
"portfolio",
"performance",
"data",
"properly",
"formatted",
"for",
"Pyfolio",
"analysis",
"."
] | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/performance.py#L1163-L1320 | train | Create a new portfolio from a factor data set and return it. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/tears.py | create_summary_tear_sheet | def create_summary_tear_sheet(factor_data,
long_short=True,
group_neutral=False):
"""
Creates a small summary tear sheet with returns, information, and turnover
analysis.
Parameters
----------
factor_data : pd.DataFrame - MultiIndex
... | python | def create_summary_tear_sheet(factor_data,
long_short=True,
group_neutral=False):
"""
Creates a small summary tear sheet with returns, information, and turnover
analysis.
Parameters
----------
factor_data : pd.DataFrame - MultiIndex
... | [
"def",
"create_summary_tear_sheet",
"(",
"factor_data",
",",
"long_short",
"=",
"True",
",",
"group_neutral",
"=",
"False",
")",
":",
"# Returns Analysis",
"mean_quant_ret",
",",
"std_quantile",
"=",
"perf",
".",
"mean_return_by_quantile",
"(",
"factor_data",
",",
"... | Creates a small summary tear sheet with returns, information, and turnover
analysis.
Parameters
----------
factor_data : pd.DataFrame - MultiIndex
A MultiIndex DataFrame indexed by date (level 0) and asset (level 1),
containing the values for a single alpha factor, forward returns for
... | [
"Creates",
"a",
"small",
"summary",
"tear",
"sheet",
"with",
"returns",
"information",
"and",
"turnover",
"analysis",
"."
] | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/tears.py#L63-L162 | train | Creates a small summary tear sheet with returns information and turnover analysis. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
quantopian/alphalens | alphalens/tears.py | create_returns_tear_sheet | def create_returns_tear_sheet(factor_data,
long_short=True,
group_neutral=False,
by_group=False):
"""
Creates a tear sheet for returns analysis of a factor.
Parameters
----------
factor_data : pd.DataFrame - M... | python | def create_returns_tear_sheet(factor_data,
long_short=True,
group_neutral=False,
by_group=False):
"""
Creates a tear sheet for returns analysis of a factor.
Parameters
----------
factor_data : pd.DataFrame - M... | [
"def",
"create_returns_tear_sheet",
"(",
"factor_data",
",",
"long_short",
"=",
"True",
",",
"group_neutral",
"=",
"False",
",",
"by_group",
"=",
"False",
")",
":",
"factor_returns",
"=",
"perf",
".",
"factor_returns",
"(",
"factor_data",
",",
"long_short",
",",... | Creates a tear sheet for returns analysis of a factor.
Parameters
----------
factor_data : pd.DataFrame - MultiIndex
A MultiIndex DataFrame indexed by date (level 0) and asset (level 1),
containing the values for a single alpha factor, forward returns for
each period, the factor qua... | [
"Creates",
"a",
"tear",
"sheet",
"for",
"returns",
"analysis",
"of",
"a",
"factor",
"."
] | d43eac871bb061e956df936794d3dd514da99e44 | https://github.com/quantopian/alphalens/blob/d43eac871bb061e956df936794d3dd514da99e44/alphalens/tears.py#L166-L321 | train | Creates a tear sheet for the returns analysis of a factor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.