[ts-gen] MacOS Shim problems - the orders problem
Mike Thornton
endoscope at gmail.com
Mon May 25 23:23:09 EDT 2009
Hi Paul, Bill,
I have noticed similar behavior with the build prior to 5-22-09 -- with the
last build, I needed to add sleep commands for commands to be executed
properly. If I attempted to submit several market data requests in
succession as indicated by the python code below, then all but the first
were ignored. If I left the sleep command commented out as below, I saw
only a subscription to the USD:SEK contract. If I uncommented the sleep
command, then I was able to receive market data subscriptions to all the
currency contracts listed below.
shimProcess.stdin.write("select tick CASH:IDEALPRO:USD:SEK 1;\n")
shimProcess.stdin.flush()
# time.sleep(0.05)
shimProcess.stdin.write("select tick CASH:IDEALPRO:USD:CHF 1;\n")
shimProcess.stdin.flush()
# time.sleep(0.05)
shimProcess.stdin.write("select tick CASH:IDEALPRO:USD:JPY 1;\n")
shimProcess.stdin.flush()
# time.sleep(0.05)
shimProcess.stdin.write("select tick CASH:IDEALPRO:GBP:USD
1;\n")
shimProcess.stdin.flush()
--Mike
On Mon, May 25, 2009 at 4:08 AM, Paul C <paulq2o0 at yahoo.co.uk> wrote:
> Bill,
>
> A couple of observations that may give a clue about the Orders
> problem (incidently the shim seemed to start up in risk mode as
> normal):
>
> > Unfortunately, the release earlier today breaks orders, and it's
> > not clear at this moment where the problem is.
>
> I've found two ways of getting orders to work again. Probably neither
> is the solution, but maybe it will help reveal the problem:
>
> 1) Adding small delays between each command sent to the shim (by
> exs/risk.rb) seems to restore normal functionality. e.g.
> . . .
> print src3, src4, open, skip;
> Shim.print src3; sleep 0.01 # <---
> Shim.print src4; sleep 0.01 # <---
> Shim.print open; sleep 0.01
> Shim.print skip; sleep 2
>
> etc, for all statements including the 'bind' commands
>
> 2) Setting the shim to no-buffering on STDIN by (experimentally) adding
> setvbuf(stdin,NULL,_IONBF,0) to the shim source code (rather arbitrarily
> I put it before the 'while' statement in src/shim.c). Note, that's
> IONBF, not IOLBF, which didn't seem to help matters.
>
> Either of the above makes exs/risk.rb (and variations) behave
> normally, with orders being created, modified, cancelled and/or submitted
> to tws as
> before. (Maybe the ruby sleep command causes the OS to flush the buffer?)
>
>
> > I've pushed a new
> > tarball over the earlier one of today that disables risk mode, so
> > that it will be obvious to users who download it that it can not
> > be used to submit orders.
>
> The above experiments were with the last available shim-090522.tgz
> timestamp 23:28:00 [GMT perhaps], which seemed to start in risk mode as
> normal; hopefully
> there if no significance to that. (Without either of the above changes
> the shim gives errors beginning 'Problem: 442 bind order var to
> template before ordering'....)
>
> PS: I've just tried a single "sleep 0.01" between the two 'bind'
> statements in risk.rb, and that seems to be sufficient.
> I hope something in there is helpful.
>
> Regards
>
> Paul
> _______________________________________________
> ts-general mailing list
> ts-general at trading-shim.org
> http://www.trading-shim.org/mailman/listinfo/ts-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.trading-shim.org/pipermail/ts-general/attachments/20090525/91e507b9/attachment.html
More information about the ts-general
mailing list