[ts-gen] MacOS Shim problems

Richard Pruss boadie at gmail.com
Fri May 15 00:55:22 EDT 2009


My dev machine has layers of crud on it which I was worried was
causing this so I set it all up on a clean new built 10.5 macpro.
With just xcode and mysql from mysql.com site.

   Same result I am afraid it still fails to connect if .shimrc
specifics localhost and when I use

I also ran into the same error as the first time I built trading shim:
"

The trading shim has connected to the database server

The record with uid 65536 from table Symbol is out of sequence.
Fill: 1 65536 45188 Symbol
Dbms: uid(65536) next(45188)

"

With a couple months more experience I looked at the Symbol table and
found that there was a discontinuity between 65536 and 45188.  A bit
more digging and I found this was a bug in auto-increment for innodb.
To get around it I set

"innodb_autoinc_lock_mode = 2"

in the innodb section of my.cnf, allot easier than getting an old
version of mysql.
Here is a blog that talks about the problem:
http://mysqlinsights.blogspot.com/2009/03/auto-increment-stability.html
and here is where I found the solution.
http://dev.mysql.com/doc/refman/5.1/en/innodb-auto-increment-handling.html

Here is the command output you asked for
richard-prusss-macpro31:shim-090428 ricpruss$ ./shim --data cout

          The trading shim has connected to the database server and
          loaded  51620 products.  The IB tws offered api level 44,
          and connection negotiation resulted in an api level of 23
          and a client id of  1.  A query shows the account code to
          be DU60320.  Program initialization has been completed.

  305|42506|   4948219|4|100| 0|# |4|100|0|****************|
  305|42506|   4948249|4|101| 0|# |4|101|0|0.93|090428|data|
  305|42506|   4948252|4|100| 0|# |4|100|0|****************|
  305|42506|   4948216|4|102| 0|# |4|102|0|23|1|44|20090515 11:48:25
Eastern Standard Time (New South Wales)|Connect with: cv 23, id 1, sv
44|
  305|42506|   4948184|3| 9| 1|1|
  305|42506|   4950767|3| 4| 2|      -1|2104|Market data farm
connection is OK:usfarm|
  305|42506|   4950961|3| 6| 2|AccountCode                     |
DU60320|    |DU60320|
  305|42506|   4951104|4|103| 0|# |4|103|0|wait|
  305|42506|   4951152|3| 6| 2|AccountReady                    |
true|    |DU60320|
  305|42506|   4951172|3| 6| 2|AccountType                     |
UNIVERSAL|    |DU60320|
  305|42506|   4951188|3| 6| 2|AccruedCash                     |
0.00|BASE|DU60320|
  305|42506|   4951192|4|103| 0|# |4|103|0|read|
  305|42506|   4951479|3| 6| 2|AccruedCash                     |
0.00|USD |DU60320|
  305|42506|   4951493|3| 6| 2|AccruedCash-C                   |
0.00|USD |DU60320|
  305|42506|   4951507|3| 6| 2|AccruedCash-S                   |
0.00|USD |DU60320|
  305|42506|   4951521|3| 6| 2|AccruedDividend                 |
0.00|USD |DU60320|
  305|42506|   4951542|3| 6| 2|AccruedDividend-C               |
0.00|USD |DU60320|
  305|42506|   4951557|3| 6| 2|AccruedDividend-S               |
0.00|USD |DU60320|
  305|42506|   4951572|3| 6| 2|AvailableFunds                  |
999770.33|USD |DU60320|
  305|42506|   4951586|3| 6| 2|AvailableFunds-C                |
0.00|USD |DU60320|
  305|42506|   4951591|4|103| 0|# |4|103|0|read|
  305|42506|   4951756|3| 6| 2|AvailableFunds-S                |
999770.33|USD |DU60320|
  305|42506|   4951770|3| 6| 2|Billable                        |
0.00|USD |DU60320|
  305|42506|   4951790|3| 6| 2|Billable-C                      |
0.00|USD |DU60320|
  305|42506|   4951804|3| 6| 2|Billable-S                      |
0.00|USD |DU60320|
  305|42506|   4951818|3| 6| 2|BuyingPower
|3332567.77|USD |DU60320|
  305|42506|   4951831|3| 6| 2|CashBalance                     |
996270.33|BASE|DU60320|
  305|42506|   4951835|4|103| 0|# |4|103|0|read|
  305|42506|   4951971|3| 6| 2|CashBalance                     |
996270.33|USD |DU60320|
  305|42506|   4951983|3| 6| 2|Currency                        |
BASE|BASE|DU60320|
  305|42506|   4952002|3| 6| 2|Currency                        |
USD|USD |DU60320|
  305|42506|   4952014|3| 6| 2|Cushion                         |
0.998502|    |DU60320|
  305|42506|   4952026|3| 6| 2|DayTradesRemaining              |
 -1|    |DU60320|
  305|42506|   4952030|4|103| 0|# |4|103|0|read|
  305|42506|   4952150|3| 6| 2|DayTradesRemainingT+1           |
 -1|    |DU60320|
  305|42506|   4952163|3| 6| 2|DayTradesRemainingT+2           |
 -1|    |DU60320|
  305|42506|   4952176|3| 6| 2|DayTradesRemainingT+3           |
 -1|    |DU60320|
  305|42506|   4952188|3| 6| 2|DayTradesRemainingT+4           |
 -1|    |DU60320|
  305|42506|   4952193|4|103| 0|# |4|103|0|read|
  305|42506|   4952311|3| 6| 2|EquityWithLoanValue
|1001270.33|USD |DU60320|
  305|42506|   4952326|3| 6| 2|EquityWithLoanValue-C           |
0.00|USD |DU60320|
  305|42506|   4952342|3| 6| 2|EquityWithLoanValue-S
|1001270.33|USD |DU60320|
  305|42506|   4952357|3| 6| 2|ExcessLiquidity                 |
999770.33|USD |DU60320|
  305|42506|   4952362|4|103| 0|# |4|103|0|read|
  305|42506|   4952479|3| 6| 2|ExcessLiquidity-C               |
0.00|USD |DU60320|
  305|42506|   4952501|3| 6| 2|ExcessLiquidity-S               |
999770.33|USD |DU60320|
  305|42506|   4952513|3| 6| 2|ExchangeRate                    |
1.00|BASE|DU60320|
  305|42506|   4952527|3| 6| 2|ExchangeRate                    |
1.00|USD |DU60320|
  305|42506|   4952531|4|103| 0|# |4|103|0|read|
  305|42506|   4952641|3| 6| 2|FullAvailableFunds              |
999770.33|USD |DU60320|
  305|42506|   4952656|3| 6| 2|FullAvailableFunds-C            |
0.00|USD |DU60320|
  305|42506|   4952672|3| 6| 2|FullAvailableFunds-S            |
999770.33|USD |DU60320|
  305|42506|   4952677|4|103| 0|# |4|103|0|read|
  305|42506|   4952780|3| 6| 2|FullExcessLiquidity             |
999770.33|USD |DU60320|
  305|42506|   4952796|3| 6| 2|FullExcessLiquidity-C           |
0.00|USD |DU60320|
  305|42506|   4952878|3| 6| 2|FullExcessLiquidity-S           |
999770.33|USD |DU60320|
  305|42506|   4952893|4|103| 0|# |4|103|0|read|
  305|42506|   4953059|3| 6| 2|FullInitMarginReq               |
1500.00|USD |DU60320|
  305|42506|   4953074|3| 6| 2|FullInitMarginReq-C             |
0.00|USD |DU60320|
  305|42506|   4953100|3| 6| 2|FullInitMarginReq-S             |
1500.00|USD |DU60320|
  305|42506|   4953115|3| 6| 2|FullMaintMarginReq              |
1500.00|USD |DU60320|
  305|42506|   4953120|4|103| 0|# |4|103|0|read|
  305|42506|   4953447|3| 6| 2|FullMaintMarginReq-C            |
0.00|USD |DU60320|
  305|42506|   4953453|4|103| 0|# |4|103|0|read|
  305|42506|   4953524|3| 6| 2|FullMaintMarginReq-S            |
1500.00|USD |DU60320|
  305|42506|   4953538|3| 6| 2|FutureOptionValue               |
0.00|BASE|DU60320|
  305|42506|   4953543|4|103| 0|# |4|103|0|read|
  305|42506|   4953633|3| 6| 2|FutureOptionValue               |
0.00|USD |DU60320|
  305|42506|   4953645|3| 6| 2|FuturesPNL                      |
0.00|BASE|DU60320|
  305|42506|   4953650|4|103| 0|# |4|103|0|read|
  305|42506|   4953729|3| 6| 2|FuturesPNL                      |
0.00|USD |DU60320|
  305|42506|   4953744|3| 6| 2|GrossPositionValue              |
5000.00|USD |DU60320|
  305|42506|   4953749|4|103| 0|# |4|103|0|read|
  305|42506|   4953840|3| 6| 2|GrossPositionValue-S            |
5000.00|USD |DU60320|
  305|42506|   4953855|3| 6| 2|InitMarginReq                   |
1500.00|USD |DU60320|
  305|42506|   4953869|3| 6| 2|InitMarginReq-C                 |
0.00|USD |DU60320|
  305|42506|   4953874|4|103| 0|# |4|103|0|read|
  305|42506|   4953970|3| 6| 2|InitMarginReq-S                 |
1500.00|USD |DU60320|
  305|42506|   4953982|3| 6| 2|Leverage-S                      |
0.00|    |DU60320|
  305|42506|   4953998|3| 6| 2|LookAheadAvailableFunds         |
999770.33|USD |DU60320|
  305|42506|   4954003|4|103| 0|# |4|103|0|read|
  305|42506|   4954107|3| 6| 2|LookAheadAvailableFunds-C       |
0.00|USD |DU60320|
  305|42506|   4954125|3| 6| 2|LookAheadAvailableFunds-S       |
999770.33|USD |DU60320|
  305|42506|   4954141|3| 6| 2|LookAheadExcessLiquidity        |
999770.33|USD |DU60320|
  305|42506|   4954146|4|103| 0|# |4|103|0|read|
  305|42506|   4954241|3| 6| 2|LookAheadExcessLiquidity-C      |
0.00|USD |DU60320|
  305|42506|   4954258|3| 6| 2|LookAheadExcessLiquidity-S      |
999770.33|USD |DU60320|
  305|42506|   4954264|4|103| 0|# |4|103|0|read|
  305|42506|   4955522|3| 6| 2|LookAheadInitMarginReq          |
1500.00|USD |DU60320|
  305|42506|   4955528|4|103| 0|# |4|103|0|read|
  305|42506|   4955606|3| 6| 2|LookAheadInitMarginReq-C        |
0.00|USD |DU60320|
  305|42506|   4955612|4|103| 0|# |4|103|0|read|
  305|42506|   4955806|3| 6| 2|LookAheadInitMarginReq-S        |
1500.00|USD |DU60320|
  305|42506|   4955812|4|103| 0|# |4|103|0|read|
  305|42506|   4956291|3| 6| 2|LookAheadMaintMarginReq         |
1500.00|USD |DU60320|
  305|42506|   4956296|4|103| 0|# |4|103|0|read|
  305|42506|   4956374|3| 6| 2|LookAheadMaintMarginReq-C       |
0.00|USD |DU60320|
  305|42506|   4956391|3| 6| 2|LookAheadMaintMarginReq-S       |
1500.00|USD |DU60320|
  305|42506|   4956396|4|103| 0|# |4|103|0|read|
  305|42506|   4956477|3| 6| 2|LookAheadNextChange             |
  0|    |DU60320|
  305|42506|   4956498|3| 6| 2|MaintMarginReq                  |
1500.00|USD |DU60320|
  305|42506|   4956503|4|103| 0|# |4|103|0|read|
  305|42506|   4956647|3| 6| 2|MaintMarginReq-C                |
0.00|USD |DU60320|
  305|42506|   4956652|4|103| 0|# |4|103|0|read|
  305|42506|   4956720|3| 6| 2|MaintMarginReq-S                |
1500.00|USD |DU60320|
  305|42506|   4956736|3| 6| 2|NetLiquidation
|1001270.33|USD |DU60320|
  305|42506|   4956740|4|103| 0|# |4|103|0|read|
  305|42506|   4956831|3| 6| 2|NetLiquidation-C                |
0.00|USD |DU60320|
  305|42506|   4956847|3| 6| 2|NetLiquidation-S
|1001270.33|USD |DU60320|
  305|42506|   4956852|4|103| 0|# |4|103|0|read|
  305|42506|   4957730|3| 6| 2|NetLiquidationByCurrency
|1001270.33|BASE|DU60320|
  305|42506|   4957736|4|103| 0|# |4|103|0|read|
  305|42506|   4957813|3| 6| 2|NetLiquidationByCurrency
|1001270.33|USD |DU60320|
  305|42506|   4957818|4|103| 0|# |4|103|0|read|
  305|42506|   4958021|3| 6| 2|OptionMarketValue               |
0.00|BASE|DU60320|
  305|42506|   4958026|4|103| 0|# |4|103|0|read|
  305|42506|   4958091|3| 6| 2|OptionMarketValue               |
0.00|USD |DU60320|
  305|42506|   4958096|4|103| 0|# |4|103|0|read|
  305|42506|   4958727|3| 6| 2|PNL                             |
true|    |DU60320|
  305|42506|   4958744|3| 6| 2|PreviousDayEquityWithLoanValue
|1001294.83|USD |DU60320|
  305|42506|   4958749|4|103| 0|# |4|103|0|read|
  305|42506|   4958855|3| 6|
2|PreviousDayEquityWithLoanValue-S|1001294.83|USD |DU60320|
  305|42506|   4958869|3| 6| 2|RealizedPnL                     |
0.00|BASE|DU60320|
  305|42506|   4958883|3| 6| 2|RealizedPnL                     |
0.00|USD |DU60320|
  305|42506|   4958897|3| 6| 2|RegTEquity
|1001270.33|USD |DU60320|
  305|42506|   4958901|4|103| 0|# |4|103|0|read|
  305|42506|   4959022|3| 6| 2|RegTEquity-S
|1001270.33|USD |DU60320|
  305|42506|   4959036|3| 6| 2|RegTMargin                      |
2500.00|USD |DU60320|
  305|42506|   4959057|3| 6| 2|RegTMargin-S                    |
2500.00|USD |DU60320|
  305|42506|   4959071|3| 6| 2|SMA                             |
999002.33|USD |DU60320|
  305|42506|   4959084|3| 6| 2|SMA-S                           |
999002.33|USD |DU60320|
  305|42506|   4959097|3| 6| 2|StockMarketValue                |
5000.00|BASE|DU60320|
  305|42506|   4959111|3| 6| 2|StockMarketValue                |
5000.00|USD |DU60320|
  305|42506|   4959116|4|103| 0|# |4|103|0|read|
  305|42506|   4959286|3| 6| 2|TotalCashBalance                |
996270.33|BASE|DU60320|
  305|42506|   4959308|3| 6| 2|TotalCashBalance                |
996270.33|USD |DU60320|
  305|42506|   4959323|3| 6| 2|TotalCashValue                  |
996270.33|USD |DU60320|
  305|42506|   4959338|3| 6| 2|TotalCashValue-C                |
0.00|USD |DU60320|
  305|42506|   4959353|3| 6| 2|TotalCashValue-S                |
996270.33|USD |DU60320|
  305|42506|   4959368|3| 6| 2|UnalteredInitMarginReq          |
-1.00|USD |DU60320|
  305|42506|   4959383|3| 6| 2|UnalteredMaintMarginReq         |
-1.00|USD |DU60320|
  305|42506|   4959397|3| 6| 2|UnrealizedPnL                   |
1310.00|BASE|DU60320|
  305|42506|   4959411|3| 6| 2|UnrealizedPnL                   |
1310.00|USD |DU60320|
  305|42506|   4959429|3| 6| 2|WhatIfPMEnabled                 |
true|    |DU60320|
  305|42506|   4959434|4|103| 0|# |4|103|0|read|
  305|42506|   4959684|3| 7|
7|BHP|STK||0.0||USD|BHP|100|50.0|5000.0|36.9|1310.0|0.0|DU60320|
  305|42506|   4959696|3| 8| 1|11:38|
  305|42506|   4959701|3| 8| 1|11:47|
  305|42506|   4959705|4|103| 0|# |4|103|0|read|
set acct on;
exit;

The last two commands have no effect, the only way out is <cntl>-c.

This is that excuse you have been waiting for to get a shinny new intel Mac ;-)

- Ric


On Thu, May 14, 2009 at 12:29 PM, R P Herrold <herrold at owlriver.com> wrote:
>
> On Thu, 14 May 2009, Richard Pruss wrote:
>
> > When I tested the Telnet I notice Apple is tries all the Ipv6
> > localhosts first so, I change
> > the Feedhost in .shimrc to 127.0.0.1 and I seem to get a little deeper,:
> >
> >           The trading shim has connected to the database server and
> >           loaded  51620 products.  The IB tws offered api level 44,
> >           and connection negotiation resulted in an api level of 23
> >           and a client id of  1.  A query shows the account code to
> >           be DU(number removed).  Program initialization has been
> >           completed.
>
>        great ... at this point, we are as far as I can debug
> without a bit more information.  I suspect, actually, that
> Bill will have some questions as well.  The IPv6 preference by
> OS/X is troubling, but this is the way of the future, I
> guess,  I was wrestling it with our local 'distcc' setup as
> well a couple months ago.
>
> > but then it freezes and shim does not accept commands.
> >
> > I can also see the two tcp4 connections in netstat are still up, when
> > the shim has frozen.
>
> The netstat command was just showing the (assumedly live)
> connection to the TWS Java.  It is not clear that the shim was
> 'frozen' or jsut waiting for commands.
>
> > The things that puzzle me are:
> > -  why does shim freeze somewhere between that initialize message and
> > the prompt from shim coming up
>
> ... continuing. Actually, there is no 'prompt' per se offered
> by the shim -- it is ready for commands at that point.  It may
> well be if you had simply started giving it commands, it would
> have properly reacted to them.  The simplest form is:
>
> exit;<CR>
>
> and the system prompt would then have appeared after the shim
> exited.   Assuming that works, re-start the shim thus:
>
> ./shim --data cout<CR>
>
> which tells the shim to emit output to the standard
> (character) out.  More detail -- the three lines of startup
> connection details, and optionaly some accounting data.   Then
> we can use a longer form:
>
> set acct on;<CR>
>    ... wait say 20 seconds ...
> exit;<CR>
>
> I posted a brief response a week or so ago on the Yahoo!
> twsapi mailing list on looking up a 'market data' stream for
> the TICK-NYSE indicator, and then for the stock 'T' using just
> a couple of lines of commands.  It is outside of market hours
> on the NYSE of course, or I would set up a quick test.
>
> > - why does using localhost say no connection for TWS, did it try to
> > connect v6? but 127.0.0.1 seems to connect at least.
>
> As to that, as I do not have an Intel iMac yet, and my PPC mac
> will not take OS/X 10.5, I cannot answer without speculation.
> ;(
>
> -- Russ herrold
> _______________________________________________
> ts-general mailing list
> ts-general at trading-shim.org
> http://www.trading-shim.org/mailman/listinfo/ts-general



More information about the ts-general mailing list