| 140 | |
| 141 | |
| 142 | class EWrapper: |
| 143 | def __init__(self): |
| 144 | pass |
| 145 | |
| 146 | def error( |
| 147 | self, |
| 148 | reqId: TickerId, |
| 149 | errorTime: int, |
| 150 | errorCode: int, |
| 151 | errorString: str, |
| 152 | advancedOrderRejectJson="", |
| 153 | ): |
| 154 | """This event is called when there is an error with the |
| 155 | communication or when TWS wants to send a message to the client.""" |
| 156 | |
| 157 | logAnswer(current_fn_name(), vars()) |
| 158 | if advancedOrderRejectJson: |
| 159 | logger.error( |
| 160 | "ERROR %s %s %s %s %s", |
| 161 | reqId, |
| 162 | errorTime, |
| 163 | errorCode, |
| 164 | errorString, |
| 165 | advancedOrderRejectJson, |
| 166 | ) |
| 167 | else: |
| 168 | logger.error("ERROR %s %s %s %s", reqId, errorTime, errorCode, errorString) |
| 169 | |
| 170 | def winError(self, text: str, lastError: int): |
| 171 | logAnswer(current_fn_name(), vars()) |
| 172 | |
| 173 | def connectAck(self): |
| 174 | """callback signifying completion of successful connection""" |
| 175 | logAnswer(current_fn_name(), vars()) |
| 176 | |
| 177 | def marketDataType(self, reqId: TickerId, marketDataType: int): |
| 178 | """TWS sends a marketDataType(type) callback to the API, where |
| 179 | type is set to Frozen or RealTime, to announce that market data has been |
| 180 | switched between frozen and real-time. This notification occurs only |
| 181 | when market data switches between real-time and frozen. The |
| 182 | marketDataType( ) callback accepts a reqId parameter and is sent per |
| 183 | every subscription because different contracts can generally trade on a |
| 184 | different schedule.""" |
| 185 | |
| 186 | logAnswer(current_fn_name(), vars()) |
| 187 | |
| 188 | def tickPrice( |
| 189 | self, reqId: TickerId, tickType: TickType, price: float, attrib: TickAttrib |
| 190 | ): |
| 191 | """Market data tick price callback. Handles all price related ticks.""" |
| 192 | |
| 193 | logAnswer(current_fn_name(), vars()) |
| 194 | |
| 195 | def tickSize(self, reqId: TickerId, tickType: TickType, size: Decimal): |
| 196 | """Market data tick size callback. Handles all size-related ticks.""" |
| 197 | |
| 198 | logAnswer(current_fn_name(), vars()) |
| 199 |
nothing calls this directly
no outgoing calls
no test coverage detected