Page 1 of 1

New release of TWS causing problems ??

Posted: Thu Dec 21, 2017 1:08 pm
by sectorbets
TradeStation updated a new release over the weekend, and now when I load multiple TradeStation windows, only the symbols in the last window loaded are active. For example, if I load two windows, the first with SPY/SDS and the second with VXX/XIV, only the second set of symbols is in the log.

Here is the outcome when loading VXX/XIV second

20171221 07:55:28:858; 8800;note;tcExpFunc;REGISTER_CONTRACT2;-VXX -STK -USD -SMART - - -0.0000000000 -
20171221 07:55:28:858; 4216;note;toHandler;AddContract;contract added: mult=0 #set=STK#sbl=VXX#lsl=#cur=USD#exc=SMART#pex=#exp=#mul=#mnt=0.0000000000#rgt=#srk=0.0000000000#sit=#sid=#als=#cid=0#vld=0# #id=50005 context=RegisterContract
20171221 07:55:28:858; 4216;note;RequestStack;AddDetailRequest;detail requests stacked=1, detail requests pending=0, other requests stored=0, type of current request=0
20171221 07:55:28:859; 8800;note;tcExpFunc;REGISTER_CONTRACT2;ret=50005
20171221 07:55:28:859; 8800;note;tcExpFunc;REGISTER_CONTRACT2;-XIV -STK -USD -SMART - - -0.0000000000 -

and here is what I get if I load SPY/SDS second -- there are no changes whatsoever in our code

20171221 08:05:16:290; 6152;note;tcExpFunc;REGISTER_CONTRACT2;-SPY -STK -USD -SMART - - -0.0000000000 -
20171221 08:05:16:290; 10072;action;TWSSocket;FinishRequest;command [reqContractDetails] transmitted. Bytes sent=42
20171221 08:05:16:291; 10072;action;toHandler;PerformDetailRequest;details requested for contract #set=STK#sbl=SPY#lsl=SPY#cur=USD#exc=SMART#pex=ARCA#exp=#mul=#mnt=0.0100000000#rgt=#srk=0.0000000000#sit=#sid=#als=#cid=756733#vld=1# #id=50010 reqid=1010771
20171221 08:05:16:291; 10072;note;RequestStack;AddDetailRequest;detail requests stacked=0, detail requests pending=1, other requests stored=0, type of current request=0
20171221 08:05:16:291; 6152;note;tcExpFunc;REGISTER_CONTRACT2;ret=50010
20171221 08:05:16:291; 6152;note;tcExpFunc;REGISTER_CONTRACT2;-SDS -STK -USD -SMART - - -0.0000000000 -

Is there some setting I should check that maybe the new release of TradeStation has turned off ??

Re: New release of TS causing problems ??

Posted: Thu Dec 21, 2017 1:10 pm
by sectorbets
The title is incorrect -- I meant to say TS, not TWS

Re: New release of TWS causing problems ??

Posted: Thu Dec 21, 2017 3:00 pm
by sectorbets
I rolled back to the previous version of TradeStation (Version 9.5 Update 21) and the problem persists.

So I looked a little closer, and it turns out that IB pushed out an update to TWS this morning as well, so I will see what I can find out about it -- any ideas would be appreciated.

Re: New release of TWS causing problems ??

Posted: Thu Dec 21, 2017 3:46 pm
by sectorbets
I have done everything I can think of, and the problem persists

1) I rolled back TradeStation to previous release
2) I went back to an earlier IB release
3) I loaded the two TS windows at the same time
4) I loaded the TS windows one at a time

And TWSLink only seems to recognize the last TS window loaded after running perfectly with the exact code and exact window setup for many months.

Re: New release of TWS causing problems ??

Posted: Thu Dec 21, 2017 5:10 pm
by board_admin
Have you checked TS settings, where you can define how many processes created.
If you miss a TWSLink call in the log, it seems that TWSLink is not loaded here.

Re: New release of TWS causing problems ??

Posted: Thu Dec 21, 2017 5:25 pm
by sectorbets
I spoke to the TS folks and they suggested running in Compatability performance mode -- I was previously letting TS decide what mode -- and now everything is back to normal. All I had done was upgrade to TS 9.5 Update 22, so they must have changed their algorithm for deciding what mode they would use in the new release

Re: New release of TWS causing problems ??

Posted: Thu Dec 21, 2017 7:20 pm
by sectorbets
The TS folks had me try a couple of things, and they believe that the problems I saw after installing the new release are due to the way they handle multiple cores -- it is apparently different from before. Running in compatability mode seems to solve the problem, but they can't guarantee that will be true forever.

They sent me this link that talks about writing DLL's for multiple cores -- you probably already have it.

DLL white paper for multi-core:
https://community.tradestation.com/disc ... alysis.pdf

Re: New release of TWS causing problems ??

Posted: Fri Dec 22, 2017 3:06 pm
by board_admin
The main problem is TradeStation (TS), because TS splits into multiple cores.
I believe they did this, because they feared the effort to turn their 32 bit code into 64 bit code.
As a result you have multiple 32 bit processes instead of one 64 bit process, which has "no" memory
limits.

They "sell" it as a feature. I have my doubts.

What they suggest in the paper of your link, is a mechanism how to share information amongst multiple dll instances.
For instance, information stored in global variables.

I don't think it is related to your issue where it seems that in one or more charts TWSLink is not loaded at all.
Changes in TWSLink wont help here and i don't want to make changes only for one application.

If possible, switch off multiple core feature, so that TWSLink is loaded only once.

Re: New release of TWS causing problems ??

Posted: Fri Dec 29, 2017 1:13 pm
by sectorbets
How do I switch off multiple cores -- the problem has returned after working OK for a couple of days.

Thank you
Rick

Re: New release of TWS causing problems ??

Posted: Fri Dec 29, 2017 1:40 pm
by sectorbets
Well, I thought Compatibility mode turned off multiple cores, but the problem had returned, and I would have multiple Orchart processes running so multiple cores was obviously running.

I tried switching back and forth between the various options, and for no particular reason, I right now have a single core running, so maybe I will just have to mess with it every morning until I have just one core running.

Ideas??

Re: New release of TWS causing problems ??

Posted: Fri Dec 29, 2017 3:07 pm
by board_admin
Having TS running in only 1 process should remove the problem.

Re: New release of TWS causing problems ??

Posted: Fri Dec 29, 2017 5:21 pm
by sectorbets
Yes, it works fine with just one process, but for some reason TS sometimes starts additional processes, and then the problem reappears -- I realize it isn't in your code, but was hoping you might have some idea about how to get TS to always start just one process -- compatibility mode is supposed to do that, but sometimes it doesn't do its job, or so it seems.