Multiple strategies
-
- Site Admin
- Posts: 244
- Joined: Mon Apr 24, 2017 3:24 pm
Re: Multiple strategies
Do you have both TS desktops running and how many ochart.exe can you see in the taskmanager ?
Thank you
Thank you
-
- Posts: 92
- Joined: Wed Apr 26, 2017 12:41 pm
Re: Multiple strategies
both TS desktops are running and there is just one orchart.exe
-
- Site Admin
- Posts: 244
- Joined: Mon Apr 24, 2017 3:24 pm
Re: Multiple strategies
So we have isolated the problem:
As TWSLink is loaded in this process (or TS loads DLLs in this process),
you can only have one TWSLink instance. So a 2nd call of CONNECT disconnects the prev. session (in your case the live connection).
Perhaps it is somehow possible to start multiple orchart processes, by changing parameters or so. You could ask TS support for this.
I am sorry, i can't provide help for this.
Summary: For multiplte TWSLink connections you need multiple TWSLink host processes.
As TWSLink is loaded in this process (or TS loads DLLs in this process),
you can only have one TWSLink instance. So a 2nd call of CONNECT disconnects the prev. session (in your case the live connection).
Perhaps it is somehow possible to start multiple orchart processes, by changing parameters or so. You could ask TS support for this.
I am sorry, i can't provide help for this.
Summary: For multiplte TWSLink connections you need multiple TWSLink host processes.
-
- Posts: 92
- Joined: Wed Apr 26, 2017 12:41 pm
Re: Multiple strategies
You have been great -- can't fix a problem until we know where it is.
TS allows charts to run on multiple processors, although they warn that many DLL's will become erratic when using multiple processors -- I will give it a try after the close to see if it launches multiple orchart's when I turn on additional processors
TS allows charts to run on multiple processors, although they warn that many DLL's will become erratic when using multiple processors -- I will give it a try after the close to see if it launches multiple orchart's when I turn on additional processors
-
- Site Admin
- Posts: 244
- Joined: Mon Apr 24, 2017 3:24 pm
Re: Multiple strategies
The TWSLink won't get erratic. But what could happen is, that you are not able to control which scripts (production, development)
are running in what orchart process. But for your purpose, you need to know this.
are running in what orchart process. But for your purpose, you need to know this.
-
- Posts: 92
- Joined: Wed Apr 26, 2017 12:41 pm
Re: Multiple strategies
I am running on a virtual machine at a large data center, and it appears that it is emulating a single processor, so I couldn't test multi processors to see what happens.
However I turned on two processors on a local machine, and TS did start a second orchart process, but I don't have TWSLInk on that machine for testing -- could you send me the setup routines so I can load them on that machine, and if it works, I'll see if the data center can emulate multiple processors.
However I turned on two processors on a local machine, and TS did start a second orchart process, but I don't have TWSLInk on that machine for testing -- could you send me the setup routines so I can load them on that machine, and if it works, I'll see if the data center can emulate multiple processors.
-
- Posts: 92
- Joined: Wed Apr 26, 2017 12:41 pm
Re: Multiple strategies
I read more about how TS assigns charts to processors, and it is a round robin allocation -- chart 1 goes to processor 1, chart 2 goes to processor 2, chart 3 goes to processor 1, and so forth until all the charts are assigned. I might be able to trick it by manually loading the charts -- I will never have more than a dozen active charts and the same charts are active all day, but if not, I may have to give up.
I was thinking maybe I could test for which socket is next in the round robin and take action based on that -- are you able to read the active socket ??
Thank you
Rick
I was thinking maybe I could test for which socket is next in the round robin and take action based on that -- are you able to read the active socket ??
Thank you
Rick
-
- Site Admin
- Posts: 244
- Joined: Mon Apr 24, 2017 3:24 pm
Re: Multiple strategies
No, TWSLink has no such function. The problem is the TS, not TWSLink.
My advice: move to MultiCharts.
My advice: move to MultiCharts.
-
- Posts: 92
- Joined: Wed Apr 26, 2017 12:41 pm
Re: Multiple strategies
Where can I find a list of exchanges to be used in the Register_Contract statement??
Thank you
Rick
Thank you
Rick
-
- Site Admin
- Posts: 244
- Joined: Mon Apr 24, 2017 3:24 pm
Re: Multiple strategies
There is no such list. Just use the exchanges possible in TWS
-
- Posts: 92
- Joined: Wed Apr 26, 2017 12:41 pm
Re: Multiple strategies
OK -- we are back to the simple stuff -- I will tackle the multi processor case after everything is running.
It its simplest mode, I want to run a single desktop with three work spaces open, and each work space has its own script.
Do I run Connection = CONNECT("",7498,2,500) in each work space with a different client ID (2 and then 3 and then 4) or do I do something different. We have proven that only one copy of TWSLink has been loaded
It its simplest mode, I want to run a single desktop with three work spaces open, and each work space has its own script.
Do I run Connection = CONNECT("",7498,2,500) in each work space with a different client ID (2 and then 3 and then 4) or do I do something different. We have proven that only one copy of TWSLink has been loaded
-
- Site Admin
- Posts: 244
- Joined: Mon Apr 24, 2017 3:24 pm
Re: Multiple strategies
I you are sure that all those workspaces are loaded in one process,
so TWSLink is loaded only once, then just do the same call with same parameters in each script.
If you call CONNECT("",7498,2,500)
and then
CONNECT("",7498,3,500)
Then TWSLink will disconnect and reconnect with clientid=3. So makes no sense.
Just call
CONNECT("",port,clientid,500)
i each script.
Please mind this relation:
process 1 ---- 1 TWSLink 1 ---- 1 IB
so TWSLink is loaded only once, then just do the same call with same parameters in each script.
If you call CONNECT("",7498,2,500)
and then
CONNECT("",7498,3,500)
Then TWSLink will disconnect and reconnect with clientid=3. So makes no sense.
Just call
CONNECT("",port,clientid,500)
i each script.
Please mind this relation:
process 1 ---- 1 TWSLink 1 ---- 1 IB
-
- Posts: 92
- Joined: Wed Apr 26, 2017 12:41 pm
Re: Multiple strategies
Everything seems to be working fine -- thanks for all your help. I will run as is for a couple of weeks, and assuming no problems, I will try working with two processors to see what happens.
Rick
Rick
-
- Site Admin
- Posts: 244
- Joined: Mon Apr 24, 2017 3:24 pm
Re: Multiple strategies
Thank you for feedback. Always appreciated.