trading_agent.doctor.checks.unified_broker_interface_check
¶
Checks that tradingmachine's settings file exists and UBI answers.
Any HTTP answer, even an error status, means UBI is running. Only a refused or timed-out connection counts as a failure.
Typical usage example:
result = UnifiedBrokerInterfaceCheck(Path('/home/pramod/Projects/tradingmachine/.env')).run()
UnifiedBrokerInterfaceCheck
¶
Bases: DoctorCheck
Checks the route from the agent to UBI through tradingmachine.
Creates the check.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
environment_file
|
Path
|
The .env file tradingmachine reads its UBI address from. |
required |
Source code in src/trading_agent/doctor/checks/unified_broker_interface_check.py
run
¶
Reads UBI's address from tradingmachine and sends it one request.
Returns:
| Type | Description |
|---|---|
CheckResult
|
OK when UBI answers, failed when the settings file is missing or UBI cannot be reached. |