Hi Paul, Bill,<br><br><br>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.<br>
<br> shimProcess.stdin.write("select tick CASH:IDEALPRO:USD:SEK 1;\n") <br> shimProcess.stdin.flush() <br> # time.sleep(0.05)<br> shimProcess.stdin.write("select tick CASH:IDEALPRO:USD:CHF 1;\n") <br>
shimProcess.stdin.flush()<br> # time.sleep(0.05) <br> shimProcess.stdin.write("select tick CASH:IDEALPRO:USD:JPY 1;\n") <br> shimProcess.stdin.flush()<br> # time.sleep(0.05) <br>
shimProcess.stdin.write("select tick CASH:IDEALPRO:GBP:USD 1;\n") <br> shimProcess.stdin.flush()<br><br>--Mike<br><br><div class="gmail_quote">On Mon, May 25, 2009 at 4:08 AM, Paul C <span dir="ltr"><<a href="mailto:paulq2o0@yahoo.co.uk" target="_blank">paulq2o0@yahoo.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Bill,<br>
<br>
A couple of observations that may give a clue about the Orders<br>
problem (incidently the shim seemed to start up in risk mode as<br>
normal):<br>
<br>
> Unfortunately, the release earlier today breaks orders, and it's<br>
> not clear at this moment where the problem is.<br>
<br>
I've found two ways of getting orders to work again. Probably neither<br>
is the solution, but maybe it will help reveal the problem:<br>
<br>
1) Adding small delays between each command sent to the shim (by<br>
exs/risk.rb) seems to restore normal functionality. e.g.<br>
. . .<br>
print src3, src4, open, skip;<br>
Shim.print src3; sleep 0.01 # <---<br>
Shim.print src4; sleep 0.01 # <---<br>
Shim.print open; sleep 0.01<br>
Shim.print skip; sleep 2<br>
<br>
etc, for all statements including the 'bind' commands<br>
<br>
2) Setting the shim to no-buffering on STDIN by (experimentally) adding<br>
setvbuf(stdin,NULL,_IONBF,0) to the shim source code (rather arbitrarily<br>
I put it before the 'while' statement in src/shim.c). Note, that's<br>
IONBF, not IOLBF, which didn't seem to help matters.<br>
<br>
Either of the above makes exs/risk.rb (and variations) behave<br>
normally, with orders being created, modified, cancelled and/or submitted to tws as<br>
before. (Maybe the ruby sleep command causes the OS to flush the buffer?)<br>
<br>
<br>
> I've pushed a new<br>
> tarball over the earlier one of today that disables risk mode, so<br>
> that it will be obvious to users who download it that it can not<br>
> be used to submit orders.<br>
<br>
The above experiments were with the last available shim-090522.tgz<br>
timestamp 23:28:00 [GMT perhaps], which seemed to start in risk mode as normal; hopefully<br>
there if no significance to that. (Without either of the above changes<br>
the shim gives errors beginning 'Problem: 442 bind order var to<br>
template before ordering'....)<br>
<br>
PS: I've just tried a single "sleep 0.01" between the two 'bind'<br>
statements in risk.rb, and that seems to be sufficient.<br>
I hope something in there is helpful.<br>
<br>
Regards<br>
<br>
Paul<br>
_______________________________________________<br>
ts-general mailing list<br>
<a href="mailto:ts-general@trading-shim.org" target="_blank">ts-general@trading-shim.org</a><br>
<a href="http://www.trading-shim.org/mailman/listinfo/ts-general" target="_blank">http://www.trading-shim.org/mailman/listinfo/ts-general</a><br>
</blockquote></div><br>