79723890

Date: 2025-08-03 08:44:47
Score: 1.5
Natty:
Report link

I removed spaces before the definition of error function;

it worked. But I don't know why.

Is there anyone explain this?


from ibapi.client import EClient
from ibapi.wrapper import EWrapper
 
class TradingApp(EWrapper, EClient):
    def __init__(self):
        EClient.__init__(self,self)
        
def error(self, reqId, errorCode, errorString):
        print("Error {} {} {}".format(reqId,errorCode,errorString))
 
app = TradingApp()      
app.connect("127.0.0.1", 7497, clientId=1)
app.run()



python testreq.py
-->

ERROR -1 1754209901652 2104 Market data farm connection is OK:usfarm.nj
ERROR -1 1754209901652 2104 Market data farm connection is OK:usfuture
ERROR -1 1754209901652 2104 Market data farm connection is OK:eufarm
ERROR -1 1754209901659 2104 Market data farm connection is OK:usopt.nj
ERROR -1 1754209901660 2104 Market data farm connection is OK:cashfarm
ERROR -1 1754209901661 2104 Market data farm connection is OK:usopt
ERROR -1 1754209901661 2104 Market data farm connection is OK:usfarm
ERROR -1 1754209901662 2106 HMDS data farm connection is OK:ushmds
ERROR -1 1754209901662 2158 Sec-def data farm connection is OK:secdefil
Reasons:
  • Blacklisted phrase (1): Is there any
  • Whitelisted phrase (-1): it worked
  • Long answer (-1):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Jinwon Lee