IbcAlpha / IBC

Automation of Interactive Brokers TWS. You can download the latest release here: https://github.com/ibcalpha/ibc/releases/latest
GNU General Public License v3.0
1.07k stars 185 forks source link

v974 IBGateway logs into paper a/c even when TradingMode=live #29

Closed acowlikeobject closed 5 years ago

acowlikeobject commented 6 years ago

I just tried using IBGateway v974 with IbcAlpha v3.7.2, and IBGateway logs into my paper account even when TradingMode=live in my config.ini. When I install v972 instead of v974 and leave everything else unchanged, it works fine (logs into my live account).

Attached logs below, but these lines indicate it's picking up the live mode correctly, but still clicking on the paper login button.

2018-11-18 06:26:53:995 IBC: Trading mode from settings: tradingMode=live
2018-11-18 06:26:53:995 IBC: Setting Trading mode = live
2018-11-18 06:26:54:011 IBC: Click button: Paper Log In

Any thoughts on how to fix this would be greatly appreciated. Could this be related to their UI revamp in v974?

Complete logs:

2018-11-18 06:26:51:655 IBC: Properties file /root/IBC/config.ini not found
System Properties
------------------------------------------------------------
java.runtime.name = Java(TM) SE Runtime Environment
sun.boot.library.path = /usr/local/i4j_jres/1.8.0_152/lib/amd64
java.vm.version = 25.152-b16
java.vm.vendor = Oracle Corporation
java.vendor.url = http://java.oracle.com/
path.separator = :
java.vm.name = Java HotSpot(TM) 64-Bit Server VM
file.encoding.pkg = sun.io
user.country = US
sun.java.launcher = SUN_STANDARD
sun.os.patch.level = unknown
java.vm.specification.name = Java Virtual Machine Specification
user.dir = /root
java.runtime.version = 1.8.0_152-b16
java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
java.endorsed.dirs = /usr/local/i4j_jres/1.8.0_152/lib/endorsed
os.arch = amd64
java.io.tmpdir = /tmp
line.separator = 

java.vm.specification.vendor = Oracle Corporation
os.name = Linux
sun.jnu.encoding = ANSI_X3.4-1968
java.library.path = /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
java.specification.name = Java Platform API Specification
java.class.version = 52.0
sun.management.compiler = HotSpot 64-Bit Tiered Compilers
os.version = 4.15.0-29-generic
user.home = /root
user.timezone = Etc/UTC
java.awt.printerjob = sun.print.PSPrinterJob
file.encoding = ANSI_X3.4-1968
java.specification.version = 1.8
java.class.path = /root/Jts/ibgateway/974/jars/log4j-api-2.5.jar:/root/Jts/ibgateway/974/jars/log4j-core-2.5.jar:/root/Jts/ibgateway/974/jars/twslaunch-974.jar:/root/Jts/ibgateway/974/jars/
total-2018.jar:/root/Jts/ibgateway/974/jars/jts4launch-974.jar:/root/Jts/ibgateway/974/jars/twslaunch-install4j-1.9.jar:/root/Jts/ibgateway/974/jars/locales.jar:/opt/ibc/IBC.jar
user.name = root
java.vm.specification.version = 1.8
sun.java.command = ibcalpha.ibc.IbcGateway config/config.ini
java.home = /usr/local/i4j_jres/1.8.0_152
sun.arch.data.model = 64
user.language = en
java.specification.vendor = Oracle Corporation
awt.toolkit = sun.awt.X11.XToolkit
java.vm.info = mixed mode
java.version = 1.8.0_152
java.ext.dirs = /usr/local/i4j_jres/1.8.0_152/lib/ext:/usr/java/packages/lib/ext
sun.boot.class.path = /usr/local/i4j_jres/1.8.0_152/lib/resources.jar:/usr/local/i4j_jres/1.8.0_152/lib/rt.jar:/usr/local/i4j_jres/1.8.0_152/lib/sunrsasign.jar:/usr/local/i4j_jres/1.8.0_152
/lib/jsse.jar:/usr/local/i4j_jres/1.8.0_152/lib/jce.jar:/usr/local/i4j_jres/1.8.0_152/lib/charsets.jar:/usr/local/i4j_jres/1.8.0_152/lib/jfr.jar:/usr/local/i4j_jres/1.8.0_152/classes
java.vendor = Oracle Corporation
file.separator = /
java.vendor.url.bug = http://bugreport.sun.com/bugreport/
sun.io.unicode.encoding = UnicodeLittle
sun.cpu.endian = little
sun.cpu.isalist = 
------------------------------------------------------------
2018-11-18 06:26:51:659 IBC: Using default settings provider: ini file is config/config.ini
2018-11-18 06:26:51:659 IBC: Using default login manager: getting username and password from args but not found. Will get from settings
2018-11-18 06:26:51:659 IBC: Using default config dialog manager: constructor parameter isGateway=true
2018-11-18 06:26:51:659 IBC: Using default trading mode manager: constructor parameter args but trading mode not present - will be taken from settings
2018-11-18 06:26:51:660 IBC: Using default config dialog manager
2018-11-18 06:26:51:665 IBC: CommandServer is not started because the port is not configured
2018-11-18 06:26:51:666 IBC: Gateway will be shut down at 2018/11/24 22:00
2018-11-18 06:26:51:785 IBC: TWS Settings directory is: /root
2018-11-18 06:26:51:786 IBC: Ensuring /root/jts.ini contains required minimal lines
2018-11-18 06:26:51:787 IBC: Found section: [Logon]
2018-11-18 06:26:51:787 IBC: Can't find setting: s3store=false
2018-11-18 06:26:51:787 IBC: Found section: [Logon]
2018-11-18 06:26:51:787 IBC: Found setting: s3store=true
2018-11-18 06:26:51:787 IBC: Found section: [IBGateway]
2018-11-18 06:26:51:787 IBC: Found setting: ApiOnly=true
2018-11-18 06:26:51:787 IBC: Confirmed /root/jts.ini contains required minimal lines
2018-11-18 06:26:53:991 IBC: Detected frame entitled: IB Gateway; event=Activated
2018-11-18 06:26:53:994 IBC: Detected frame entitled: IB Gateway; event=Opened
2018-11-18 06:26:53:995 IBC: Trading mode from settings: tradingMode=live
2018-11-18 06:26:53:995 IBC: Setting Trading mode = live
2018-11-18 06:26:54:011 IBC: Click button: Paper Log In
2018-11-18 06:26:54:699 IBC: Detected frame entitled: IB Gateway.  API Account: username; event=Activated
2018-11-18 06:26:54:701 IBC: Detected frame entitled: IB Gateway.  API Account: username; event=Opened
2018-11-18 06:26:54:701 IBC: Found Gateway main window
2018-11-18 06:26:54:837 IBC: Detected frame entitled: Authenticating...; event=Activated
2018-11-18 06:26:54:838 IBC: Detected frame entitled: Authenticating...; event=Opened
LogModuleConfigurator-Init: Log4j Ver2.x found on classpath
LogModuleConfigurator-Init: LogModuleConfigurator initialized with Log4j Verd.x
2018-11-18 06:26:57:112 IBC: Detected frame entitled: Starting application...; event=Closed
2018-11-18 06:26:57:185 IBC: Detected dialog entitled: Warning; event=Opened
2018-11-18 06:26:57:185 IBC: Click button: I understand and accept
2018-11-18 06:26:57:276 IBC: Detected dialog entitled: Warning; event=Closed
rlktradewright commented 6 years ago

Thanks for that. I can confirm what you're seeing.

I'm not quite sure why, but it appears that when IBC clicks the Live Trading toggle nothing is happening.

I'll investigate further tomorrow, but it'll probably be evening before I can make a fix, because my live account is in use all day till 22:00 GMT so I can't keep starting and stopping it.

To work round this, edit the jts.ini file and make sure it has

tradingMode=l

rather than

tradingMode=p

By the way, if you want to run sometimes live and sometimes paper, or both at the same time, it's best to have two different setups with different TWS/Gateway settings directories. I think the User Guide has a section on this if you're not sure how to do this.

acowlikeobject commented 6 years ago

Thanks for the workarounds. I'll watch for a new release in the next few days.

And yes, two setups for live and paper sound like a good idea.

rlktradewright commented 6 years ago

Fixed in Release 3.7.3