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(&quot;select tick CASH:IDEALPRO:USD:SEK 1;\n&quot;) <br>        shimProcess.stdin.flush()  <br>        #  time.sleep(0.05)<br>        shimProcess.stdin.write(&quot;select tick CASH:IDEALPRO:USD:CHF 1;\n&quot;) <br>

        shimProcess.stdin.flush()<br>        #    time.sleep(0.05)        <br>        shimProcess.stdin.write(&quot;select tick CASH:IDEALPRO:USD:JPY 1;\n&quot;)  <br>        shimProcess.stdin.flush()<br>        #    time.sleep(0.05)           <br>

        shimProcess.stdin.write(&quot;select tick CASH:IDEALPRO:GBP:USD 1;\n&quot;)                                <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">&lt;<a href="mailto:paulq2o0@yahoo.co.uk" target="_blank">paulq2o0@yahoo.co.uk</a>&gt;</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>
&gt; Unfortunately, the release earlier today breaks orders, and it&#39;s<br>
&gt; not clear at this moment where the problem is.<br>
<br>
I&#39;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 # &lt;---<br>
    Shim.print src4; sleep 0.01 # &lt;---<br>
    Shim.print open; sleep 0.01<br>
    Shim.print skip; sleep 2<br>
<br>
    etc, for all statements including the &#39;bind&#39; 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 &#39;while&#39; statement in src/shim.c).  Note, that&#39;s<br>
IONBF, not IOLBF, which didn&#39;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>
&gt; I&#39;ve pushed a new<br>
&gt; tarball over the earlier one of today that disables risk mode, so<br>
&gt; that it will be obvious to users who download it that it can not<br>
&gt; 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 &#39;Problem: 442 bind order var to<br>
template before ordering&#39;....)<br>
<br>
PS:  I&#39;ve just tried a single &quot;sleep 0.01&quot; between the two &#39;bind&#39;<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>