Home › Forums › Trading System Mentor Course Community › Running Your Trading Business › Running two or more systems at the same time with Batch Trader
- This topic is empty.
-
AuthorPosts
-
July 26, 2016 at 2:09 pm #101511JulianCohenParticipant
This is direct from the developer and he kindly allowed me to share it with the forum. I asked him if it was possible to run Batch Trader on the S&P with one system and the Russell with a different one at the same time. here is his reply:
Hi,
It is possible to set up two separate instances, each having separate configurations.
The general layout for such a setup could be:
RootDirectory
Instance1-SP
BatchTrader-v1.2.0
….
Instance2-RUT
BatchTrader-v1.2.0
….To create the second instance, you can copy the whole BatchTrader-v1.2.0 directory (with all the files) from the first instance.
You then need to configure the second instance to use a different co called TWS client ID. Each application that connects to TWS has to use a separate value for this client ID.
To change this, go to the appdata/config directory in the second instance, and open the services.xml file with a text editor.
Locate the following section:
Change the line
to
This value of 2 will be the TWS client ID used by the second instance.
July 27, 2016 at 1:44 am #104867AnonymousInactiveJulian Cohen wrote:This is direct from the developer and he kindly allowed me to share it with the forum…Much appreciated Julian!
July 27, 2016 at 4:11 am #104868LeeDanelloParticipantI’m missing the point here. Would this be used where you have different IB accounts?
July 27, 2016 at 4:11 am #104869JulianCohenParticipantI haven’t tested it myself yet as I am still stress testing the MOC version of Batchtester, but once I have that sorted I’ll try it out. If anyone else should get it up and running in the meantime please let me know how it goes.
July 27, 2016 at 5:55 am #104873SaidBitarMemberI run them as mentioned above, so according to IB you can have up to 8 APIs connected at the same time as long as they have different IDs.
and each API will run the orders that are imported to it.so when all are connected you can see in TWS the following
(here i am trying with 3 connections)
July 27, 2016 at 6:30 am #104878LeeDanelloParticipantIf you do this does it segregate your trades from different systems?
July 27, 2016 at 7:20 am #104879SaidBitarMemberYes to run different systems
So each api will manage oneJuly 27, 2016 at 9:59 am #104880LeeDanelloParticipantUnderstand now. All for managing exposure for different systems.
July 27, 2016 at 8:22 pm #104870AnonymousInactiveI tried it today with 2 versions of BatchTrader running simultaneously, the second one being the MoC version and they worked fine together, I made the same changes as Julian shared to get more than one running on one IB account.
July 29, 2016 at 12:15 am #104871JulianCohenParticipantSo when it finally came time to follow my own instructions I could’t make it work and kept getting error messages.
Said suggested installing one copy of BatchTrader on C drive and one on the desktop as a work around and that worked for me as well.
I discussed it with the developer and he suggested putting both installations into the users own directory, like C:UsersMyUserName as in this directory each user has write access, whereas with C: it is not the case.
My second question to him was how to differentiate easily in TWS trade reports between the two systems. Was there a way to add a system name to the order in the references so that the trades can be easily split up from the trade report.
His answer: I do not see in the TWS trade log screen any column that is useful to identify trades placed by two different API clients. Would it be possible to contact IB and ask if there is a way?
So I will and will be back.
July 29, 2016 at 12:20 am #104904LeeDanelloParticipantI just copied the program into the same directory and windows appended “copy” to the end of the file name. Once I edited the XML file and saved it I was allowed to execute both Batch Trader programs.
July 29, 2016 at 2:25 am #104872JulianCohenParticipantAnd here is the reply from IB:
Thank you for contacting Interactive Brokers.
Please refer to the link below:
https://www.interactivebrokers.com/en/software/api/apiguide/java/order.htm
There is property named “m_orderRef” to allow you setup your own reference id via API. For example, you can named orders in API client 1 as client1xxxxx and use different name for the orders in another client. Then after the order executed, you will find the value you have set for different orders in “Order Ref” column.
November 23, 2016 at 6:55 am #104908TrentRothallParticipantJulian Cohen wrote:And here is the reply from IB:Thank you for contacting Interactive Brokers.
Please refer to the link below:
https://www.interactivebrokers.com/en/software/api/apiguide/java/order.htm
There is property named “m_orderRef” to allow you setup your own reference id via API. For example, you can named orders in API client 1 as client1xxxxx and use different name for the orders in another client. Then after the order executed, you will find the value you have set for different orders in “Order Ref” column.
Julian did you or anyone else do this when running 2 batch traders?
November 24, 2016 at 1:10 am #105841JulianCohenParticipantNo there’s a way to do it through Batchtrader instead. Much easier.
Open the application’s configuration file called services.xml. This file is located under the appdata/config folder (relative to the main installation directory).
In the piece of code as below, the number “1” relates to the order Ref. You can change this and it shows up in the Trade log in TWS so it’s easy to separate deal.
November 24, 2016 at 2:07 am #105843TrentRothallParticipantThanks Julian
Isn’t that the same piece i need to change to be able to run two instances of batch trader? As per instructions at the top?
-
AuthorPosts
- You must be logged in to reply to this topic.