INNER CODE UNIT · Python
ThetaClient
baileydanseglio/thetadata-python · thetadata/client.py:286
class ThetaClient:
"""A high-level, blocking client used to fetch market data. Instantiating this class
runs a java background process, which is responsible for the heavy lifting of market
data communication. Java 11 or higher is required to use this class."""
def __init__(self, port: int = 11000, timeout: Optional[float] = 60, launch: bool = True, jvm_mem: int = 0,
username: str = "default", passwd: str = "default", auto_update: bool = True, use_bundle: bool = True,
host: str = "127.0.0.1", streaming_port: int = 10000, stable: bool = True):
"""Construct a client instance to interface with market data. If no username and passwd fields are provided,
the terminal will connect to thetadata servers with free data permissions.
:param port: The port number specified in the Theta Terminal config, which can usually be found under
%user.home%/ThetaData/ThetaTerminal.
:param streaming_port: The port number of Theta Terminal Stream server
:param host: The host name or IP address of Theta Terminal server
:param timeout: The max number of seconds to wait for a response before throwing a TimeoutError
:param launch: Launches the terminal if true; uses an existing external terminal instance if false.
:param jvm_mem: Any integer provided above zero will force the terminal to allocate a maximum amount of memory in GB.