ibapi icon indicating copy to clipboard operation
ibapi copied to clipboard

Your API version does not support fractional size rules. Please upgrade to a minimum version 163

Open alekna opened this issue 11 months ago • 2 comments

Code:

func marketData(c *cli.Context) error {
	var err error
	ibwrapper := &Wrapper{}
	ctx, _ := context.WithTimeout(context.Background(), time.Second*30)
	ic := NewIbClient(ibwrapper)
	ic.SetContext(ctx)
	err = ic.Connect(c.String("api_host"), c.Int("api_port"), 0)
	if err != nil {
		log.Panic("Connect failed:", err)
	}
	if err := ic.HandShake(); err != nil {
		log.Panic("HandShake failed:", err)
	}

	ic.ReqCurrentTime()

	contract := Contract{Symbol: "EUR", SecurityType: "CASH", Currency: "USD", Exchange: "IDEALPRO"}
	ic.ReqTickByTickData(1, &contract, "BidAsk", 0, true)

	ic.Run()
	err = ic.LoopUntilDone()
	return nil
}

Log:

"level":"info","ts":1689142639.5435812,"caller":"[email protected]/client.go:107","msg":"Connect to client","host":"192.168.16.4","port":7497,"clientID":0}
{"level":"info","ts":1689142639.5439203,"caller":"[email protected]/client.go:177","msg":"HandShake with TWS or GateWay"}
{"level":"info","ts":1689142639.5537026,"caller":"[email protected]/client.go:223","msg":"handShake info","serverVersion":161}
{"level":"info","ts":1689142639.553725,"caller":"[email protected]/client.go:224","msg":"handShake info","connectionTime":"20230712 09:17:19 EET"}
{"level":"info","ts":1689142639.5560975,"caller":"[email protected]/wrapper.go:125","msg":"<ManagedAccounts>","accountList":["U........"]}
{"level":"info","ts":1689142639.5985842,"caller":"[email protected]/wrapper.go:121","msg":"<NextValidID>","reqID":1}
{"level":"info","ts":1689142639.5986145,"caller":"[email protected]/wrapper.go:112","msg":"<ConnectAck>..."}
{"level":"info","ts":1689142639.5986314,"caller":"[email protected]/client.go:272","msg":"HandShake completed"}
{"level":"info","ts":1689142639.5986576,"caller":"[email protected]/client.go:3046","msg":"run client"}
{"level":"info","ts":1689142639.5987244,"caller":"[email protected]/wrapper.go:658","msg":"<Error>","reqID":-1,"errCode":2104,"errString":"Market data farm connection is OK:usfuture"}
{"level":"info","ts":1689142639.5987353,"caller":"[email protected]/wrapper.go:658","msg":"<Error>","reqID":-1,"errCode":2104,"errString":"Market data farm connection is OK:eufarm"}
{"level":"info","ts":1689142639.5987415,"caller":"[email protected]/wrapper.go:658","msg":"<Error>","reqID":-1,"errCode":2104,"errString":"Market data farm connection is OK:cashfarm"}
{"level":"info","ts":1689142639.5987535,"caller":"[email protected]/wrapper.go:658","msg":"<Error>","reqID":-1,"errCode":2104,"errString":"Market data farm connection is OK:usfarm"}
{"level":"info","ts":1689142639.5987659,"caller":"[email protected]/wrapper.go:658","msg":"<Error>","reqID":-1,"errCode":2106,"errString":"HMDS data farm connection is OK:euhmds"}
{"level":"info","ts":1689142639.5987751,"caller":"[email protected]/wrapper.go:658","msg":"<Error>","reqID":-1,"errCode":2106,"errString":"HMDS data farm connection is OK:ushmds"}
{"level":"info","ts":1689142639.5987809,"caller":"[email protected]/wrapper.go:658","msg":"<Error>","reqID":-1,"errCode":2158,"errString":"Sec-def data farm connection is OK:secdefeu"}
{"level":"info","ts":1689142639.600078,"caller":"[email protected]/wrapper.go:652","msg":"<CurrentTime>","time":1689142639}
{"level":"info","ts":1689142639.6430283,"caller":"[email protected]/wrapper.go:658","msg":"<Error>","reqID":1,"errCode":10285,"errString":"Your API version does not support fractional size rules. Please upgrade to a minimum version 163."}

alekna avatar Jul 12 '23 06:07 alekna

Exact same issue here.

TWS error code 10285 is still not documented in API Reference at the time of this writing.

As far as I can tell, this has to do with MAX_CLIENT_VER, which is sent to TWS/GW during the handshake process.

If that value is temporarily set to 163 the error is gone, so looks like the library is behind. Need to dig deeper into it, but it should be fixable from the client side.

t00ts avatar Jul 12 '23 12:07 t00ts

I would try to catch up with the latest upgrade of IB API

hadrianl avatar Sep 25 '23 01:09 hadrianl