Skip to content

IBController: 2 arguments passed, but args[0] is not 'encrypt'. quitting... #26

@Fishman1049

Description

@Fishman1049

Hi all,

Thank you for putting in the time to create this tool. It looks exceptional. First, I already read issue #16, and have done everything that you advised to do there, to no avail. I am running windows 8.1 on a 64-bit Intel based Mac via bootcamp. I installed the entire operating system today, and have done nothing besides install Java, TWS, Python, IBController, Dropbox and Chrome on the machine. I've installed everything to their default directories. I have not attempted to modify any of the files to include my username / password, I am simply trying to get the edemo/demouser login to work. I have tried running IBControllerStart.bat by double clicking and also running in the command prompt.

First, I will copy/paste the .bat file I am running. Second, I will copy/paste the .ini file. Third, I will copy/paste the feedback given. Here's the .bat file:

:: If your TWS user id and password are not included in the IBController
:: configuration file, set them here (do not encrypt the password):

set TWSUSERID=
set TWSPASSWORD=

:: The folder containing the IBController files:

set IBCDIR=C:\IBController

:: The location and filename of the IBController configuration file. This file should
:: be in a folder in your personal filestore, so that other users of your computer can't
:: access it. This folder and its contents should also be encrypted so that even users
:: with administrator privileges can't see the contents. Note that you can use the HOMEPATH
:: environment variable to address the root of your personal filestore (HOMEPATH is set
:: automatically by Windows):

set IBCINI=%HOMEPATH%\Documents\IBController\IBController.ini

:: The folder where TWS is installed:

set TWSDIR=C:\Jts\

:: The classpath for TWS. The value below is correct for version
:: 942 (you can verify which version of TWS you are using by going
:: to the Help | About Trader Workstation menu in TWS).
::
:: For other versions of TWS, the information needed may change.
:: You can find the required information in the shortcut created when you
:: installed TWS.
::
:: To locate this in Windows 7, right click on the start menu entry for
:: TWS and click Properties. In Windows 8, locate the tile for TWS in
:: the start screen, right click it, and select 'Open file location' on the menu
:: bar at the bottom of the screen.
::
:: In the field labelled 'Target', select everything after "-cp " up to the
:: first subsequent space character, then press Ctrl-C to copy it to the
:: clipboard, then paste it into the following command, replacing everything
:: after the "=" character:

set TWSCP=jts.jar;total.2012.jar

:: Other Java VM options for TWS. You can find this information in the
:: shortcut created when you installed TWS. (Note that in the shortcut,
:: jclient/LoginFrame is NOT part of the Java options, nor is anything
:: that comes after it, so don't include that here):

set JAVAOPTS=-Dsun.java2d.noddraw=true -Dswing.boldMetal=false -Dsun.locale.formatasdefault=true -Xmx1024M -XX:MaxPermSize=256M

pushd %TWSDIR%
java.exe -cp %TWSCP%;%IBCDIR%\IBController.jar %JAVAOPTS% ibcontroller.IBController %IBCINI% %TWSUSERID% %TWSPASSWORD%
popd

Here is the .ini file

Note that in the comments in this file, TWS refers to either the Trader

Workstation or the Gateway for the IB API.

IBController may also be used to start the FIX CTCI Gateway. All settings

relating to this have names prefixed with FIX.

The IB API Gateway and the FIX CTCI Gateway share the same code. Which

gateway actually runs is governed by an option on the initial gateway

login screen. The FIX setting described under IBController Startup

Settings below controls this.

#1. IBController Startup Settings

----------------------------------

IBController logs information during operating that can be useful when

diagnosing problems. If set to 'yes', all logging output from

IBController is to the console and may be directed into a file using

the standard > or >> command line redirection operators. If set to 'no',

output from IBController that is logged after it has loaded TWS appears

in the TWS logfile: this helps to correlate IBController log entries with

TWS activity. The default is 'no'.

LogToConsole=no

IBController may be used to start the IB Gateway for the FIX CTCI. This

setting must be set to yes if the FIX CTCI gateway is to be run. The default

is no.

FIX=no
#2. Authentication Settings

----------------------------

TWS and the IB API gateway require a single username and password

For them, you can specify the username and password as the second and

third arguments in the command to start IBController. Alternatively

you may specify the username and password using the following settings:

IbLoginId

IbPassword

If you don't specify them, you will be prompted for them in the usual

login dialog when TWS starts (but whatever you have specified will be

included in the dialog automatically: for example you may specify the

username but not the password, and then you will be prompted for the

password via the login dialog).

The FIX CTCI gateway requires one username and password for FIX order

routing, and optionally a separate username and password for market

data connections. You can specify the FIX username and password as the

second and third arguments in the command to start IBController. You

can specify the market data username and password as the fourth and

fifth arguments in the command to start IBController. Alternatively

you may specify the usernames and passwords using the following settings:

FIXLoginId

FIXPassword

IbLoginId (optional)

IbPassword (optional)

If you don't specify them, you will be prompted for them in the usual

login dialog when FIX CTCI gateway starts (but whatever you have

specified will be included in the dialog automatically: for example

you may specify the usernames but not the passwords, and then you will

be prompted for the password via the login dialog).

Passwords may be specified in an 'encrypted' form. This makes

it tricky (but by no means impossible) for someone looking at this

file to know what your password is. Use these settings to indicate

whether the password(s) are encrypted:

PasswordEncrypted

FIXPasswordEncrypted

If you want to use the encrypted form, set the relevant setting to 'yes',

otherwise set it to 'no'. If you omit this setting, 'yes' is assumed.

To get the encrypted form, edit the IBControllerEncrypt.bat file

and replace "aaaaa" with your password; then run

IBControllerEncrypt.bat to display the encrypted version of

your password.

IB API Settings

---------------

Your TWS username:

IbLoginId=edemo

Your TWS password (encrypted if appropriate):

IbPassword=demouser
PasswordEncrypted=no

FIX CTCI Settings

-----------------

Your FIX CTCI username:

FIXLoginId=

Your FIX CTCI password (encrypted if appropriate):

FIXPassword=
FIXPasswordEncrypted=yes
#3. TWS Startup Settings

-------------------------

Path to the directory where TWS should store its settings. This is

normally the folder in which TWS is installed. However you may set

it to some other location if you wish (for example if you want to

run multiple instances of TWS with different settings).

It is recommended for clarity that you use an absolute path. The

effect of using a relative path is undefined.

Linux and OS X users should use the appropriate path syntax.

Note that, for Windows users, you MUST use double separator

characters to separate the elements of the folder path: for

example, IbDir=C:\IBLiveSettings is valid, but

IbDir=C:\IBLiveSettings is NOT valid and will give unexpected

results. Linux and OS X users need not use double separators,

but they are acceptable.

The default is the current working directory when IBController is

started.

IbDir=

If you wish to store your TWS settings on IB's servers rather

than locally on your computer, set this to 'yes'

StoreSettingsOnServer=no

Set to 'yes' to minimise TWS when it starts:

MinimizeMainWindow=no

When TWS logs on it checks to see whether the account is already

logged in at another computer. If so it displays a dialog: this

setting instructs TWS how to proceed. If set to 'primary', TWS

ends the existing session and continues with the new session. If

set to 'secondary', TWS exits so that the existing session is

unaffected. If set to 'manual', the user must handle the dialog.

Note that when set to 'primary', if another TWS session is

started and manually told to end the primary session, the primary

session is automaticallyreconnected. Also note that if two

primary sessions are started, they will both keep reconnecting

and disconnecting the other: therefore care needs to be exercised

in the use of this setting. The default is 'manual'.

ExistingSessionDetectedAction=manual

If set to 'accept', IBController automatically accepts incoming

API connection dialogs. If set to 'reject', IBController

automatically rejects incoming API connection dialogs. If

set to 'manual', the user must decide whether to accept or reject

incoming API connection dialogs. The default is 'accept'.

NB: it is recommended to set this to 'reject', and to explicitly

configure which IP addresses can connect to the API in TWS's API

configuration page, as this is much more secure (in this case, no

incoming API connection dialogs will occur for those IP addresses).

AcceptIncomingConnectionAction=accept

If this is set to yes, IBController causes TWS to display the

Trades log at startup, and sets the 'All' checkbox to ensure that

the API reports all executions that have occurred during the past

week. Moreover, any attempt by the user to change any of the

'Show trades' checkboxes is ignored; similarly if the user closes

the Trades log, it is immediately re-displayed with the 'All'

checkbox set. If set to 'no', IBController does not interact with

the Trades log, and only the current session's executions are

returned via the API (unless the user changes the Trades log

checkboxes). The default is no.

ShowAllTrades=no

If ForceTwsApiPort is set to an integer, it forces IBController to

change the TWS API Socket Port to that number shown shortly after

startup. This setting is most commonly required if you are running

multiple IBController instances for different accounts and would

like different ports to be configured automatically (ie without you

needing do this manually in the TWS window that IBController would

open). Leaving the setting blank will make no change, so 4001 or

#7496 would be the usual default (or whatever you manually change

the port number to).

ForceTwsApiPort=
#4. TWS Auto-Closedown

-----------------------

Set to yes or no (lower case):

yes means allow TWS to shut down automatically at its

specified shutdown time, which is set via the TWS

configuration menu.

no means TWS never shuts down automatically.

NB: IB recommends that you do not keep TWS running

continuously. If you set this setting to 'no', you may

experience incorrect TWS operation.

IbAutoClosedown=yes
#5. TWS Tidy Closedown Time

----------------------------

To tell IBController to tidily close TWS at a

specified day of the week and time, set this value

to

for example:

ClosedownAt=Friday 22:00

Note that the day of the week must be specified using your

default locale. Also note that Java will only accept

characters encoded to ISO 8859-1 (Latin-1). This means that

if the day name in your default locale uses any non-Latin-1

characters you need to encode them using Unicode escapes

(see http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.3

for details). For example, to tidily close TWS at 12:00 on

Saturday where the default locale is Simplified Chinese,

use the following:

#ClosedownAt=\u661F\u671F\u516D 12:00

ClosedownAt=
#6. Other TWS Settings

-----------------------

If you attempt to place an order for a contract for which

you have no market data subscription, TWS displays a dialog

to warn you against such blind trading.

yes means the dialog is dismissed as though the user had

clicked the 'Ok' button: this means that you accept

the risk and want the order to be submitted.

no means the dialog remains on display and must be

handled by the user.

AllowBlindTrading=no

Indian versions of TWS may display a password expiry

notification dialog and a NSE Compliance dialog. These can be

dismissed by setting the following to yes. By default the

password expiry notice is not dismissed, but the NSE Compliance

notice is dismissed.

Warning: setting DismissPasswordExpiryWarning=yes will mean

you will not be notified when your password is about to expire.

You must then take other measures to ensure that your password

is changed within the expiry period, otherwise IBController will

not be able to login successfully.

DismissPasswordExpiryWarning=no
DismissNSEComplianceNotice=yes

Since TWS 906, orders placed using the BookTrader have to be confirmed

via a dialog box (this was due to a legal dispute between IB and Trading

Technologies who claimed IB were infringing a patent). If

AutoConfirmOrders=yes, then when orders are placed using the BookTrader,

the confirmation dialog is automatically handled, thereby effectively

restoring the one-click trading. The default is 'no', requiring the user

to manually confirm each trade.

NB: this setting has been removed as the dispute has been resolved and

TWS users now have the option to request the order confirmation dialog

to not be displayed.

AutoConfirmOrders=no

#6. IBController Server Settings

---------------------------------

Do NOT CHANGE THE FOLLOWING SETTINGS unless you

intend to issue commands to IBController (for example

using telnet). Note that these settings have nothing to

do with running programs that use the TWS API.

The port that IBController listens on for commands

such as "STOP". DO NOT set this to the port number

used for TWS API connections. There is no good reason

to change this setting unless the port is used by

some other application.

IbControllerPort=7462

A comma separated list of ip addresses, or host names,

which are allowed addresses for sending commands to

IBController. Commands can always be sent from the

same host as IBController is running on.

IbControlFrom=

Specifies the IP address on which the IBController Server

is to listen. For a multi-homed host, this can be used

to specify that connection requests are only to be

accepted on the specified address. The default is to

accept connection requests on all local addresses.

IbBindAddress=

The specified string is output by the server when

the connection is first opened and after the completion

of each command. This can be useful if sending commands

using an interactive program such as telnet. The default

is that no prompt is output.

For example:

CommandPrompt=>

CommandPrompt=

Some commands can return intermediate information about

their progress. This setting controls whether such

information is sent. The default is that such information

is not sent.

SuppressInfoMessages=yes

And here is what the system returns:

Microsoft Windows Version 6.3.9600 2013 Microsoft Corporation. All rights reserved.

C:\Users\Jacob Fishman>cd C:\IBController

C:\IBController>IBControllerStart.bat

C:\IBController>set TWSUSERID=

C:\IBController>set TWSPASSWORD=

C:\IBController>set IBCDIR=C:\IBController

C:\IBController>set IBCINI=\Users\Jacob Fishman\Documents\IBController\IBControl
ler.ini

C:\IBController>set TWSDIR=C:\Jts\

C:\IBController>set TWSCP=jts.jar;total.2012.jar

C:\IBController>set JAVAOPTS=-Dsun.java2d.noddraw=true -Dswing.boldMetal=false -
Dsun.locale.formatasdefault=true -Xmx1024M -XX:MaxPermSize=256M

C:\IBController>pushd C:\Jts\

C:\Jts>java.exe -cp jts.jar;total.2012.jar;C:\IBController\IBController.jar -Ds
un.java2d.noddraw=true -Dswing.boldMetal=false -Dsun.locale.formatasdefault=true
-Xmx1024M -XX:MaxPermSize=256M ibcontroller.IBController \Users\Jacob Fishman\D
ocuments\IBController\IBController.ini
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=256M; support wa
s removed in 8.0

System Properties

swing.boldMetal = false
java.runtime.name = Java(TM) SE Runtime Environment
sun.boot.library.path = C:\Program Files (x86)\Java\jre1.8.0_45\bin
java.vm.version = 25.45-b02
java.vm.vendor = Oracle Corporation
java.vendor.url = http://java.oracle.com/
path.separator = ;
java.vm.name = Java HotSpot(TM) Client VM
file.encoding.pkg = sun.io
user.country = US
user.script =
sun.java.launcher = SUN_STANDARD
sun.os.patch.level =
java.vm.specification.name = Java Virtual Machine Specification
user.dir = C:\Jts
java.runtime.version = 1.8.0_45-b15
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs = C:\Program Files (x86)\Java\jre1.8.0_45\lib\endorsed
os.arch = x86
java.io.tmpdir = C:\Users\JACOBF~1\AppData\Local\Temp
line.separator =

java.vm.specification.vendor = Oracle Corporation
user.variant =
os.name = Windows 8.1
sun.java2d.noddraw = true
sun.jnu.encoding = Cp1252
java.library.path = C:\ProgramData\Oracle\Java\javapath;C:\Windows\Sun\Java\bin;
C:\Windows\system32;C:\Windows;C:\ProgramData\Oracle\Java\javapath;C:\Windows\sy
stem32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell
\v1.0;C:\Anaconda;C:\Anaconda\Scripts;.
java.specification.name = Java Platform API Specification
java.class.version = 52.0
sun.management.compiler = HotSpot Client Compiler
os.version = 6.3
user.home = C:\Users\Jacob Fishman
user.timezone = America/Los_Angeles
java.awt.printerjob = sun.awt.windows.WPrinterJob
file.encoding = Cp1252
java.specification.version = 1.8
java.class.path = jts.jar;total.2012.jar;C:\IBController\IBController.jar
user.name = Jacob Fishman
java.vm.specification.version = 1.8
sun.java.command = ibcontroller.IBController \Users\Jacob Fishman\Documents\IBCo
ntroller\IBController.ini
java.home = C:\Program Files (x86)\Java\jre1.8.0_45
sun.arch.data.model = 32
user.language = en
java.specification.vendor = Oracle Corporation
awt.toolkit = sun.awt.windows.WToolkit
java.vm.info = mixed mode
java.version = 1.8.0_45
java.ext.dirs = C:\Program Files (x86)\Java\jre1.8.0_45\lib\ext;C:\Windows\Sun\J
ava\lib\ext
sun.boot.class.path = C:\Program Files (x86)\Java\jre1.8.0_45\lib\resources.jar;
C:\Program Files (x86)\Java\jre1.8.0_45\lib\rt.jar;C:\Program Files (x86)\Java\j
re1.8.0_45\lib\sunrsasign.jar;C:\Program Files (x86)\Java\jre1.8.0_45\lib\jsse.j
ar;C:\Program Files (x86)\Java\jre1.8.0_45\lib\jce.jar;C:\Program Files (x86)\Ja
va\jre1.8.0_45\lib\charsets.jar;C:\Program Files (x86)\Java\jre1.8.0_45\lib\jfr.
jar;C:\Program Files (x86)\Java\jre1.8.0_45\classes
java.vendor = Oracle Corporation
sun.stderr.encoding = cp437
file.separator =
java.vendor.url.bug = http://bugreport.sun.com/bugreport/
sun.io.unicode.encoding = UnicodeLittle
sun.cpu.endian = little
sun.stdout.encoding = cp437
sun.desktop = windows
sun.locale.formatasdefault = true

sun.cpu.isalist = pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86

IBController: 2 arguments passed, but args[0] is not 'encrypt'. quitting...

C:\Jts>popd
C:\IBController>

Please let me know if there is any additional info I can provide you with. Thanks for taking the time to look at this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions