I B weekend disconnect and their server maintenance used to auto-reconnect but now it does not

Questions about MultiCharts and user contributed studies.
quantum777
Posts: 38
Joined: 18 Dec 2014
Has thanked: 6 times
Been thanked: 1 time

I B weekend disconnect and their server maintenance used to auto-reconnect but now it does not

Postby quantum777 » 09 Nov 2019

Hi, I B weekend disconnect and their server maintenance disconnect used to auto-reconnect but now it does not:
- About 5 months ago I finally was able to create a satisfactory end of day swing trade, auto-trade MC system using inverse pairs.
- I did not have a end of weekend or I B server maintenance auto-reconnect problem.
- I then munched my lower back and have laid low for months.
- Started the MC auto-trade system 10/24 (Friday) using my paper trade account (not my cash account) and went on a cruise.
- Came back on 11/8 (Friday) and discovered that there was a disconnect over the weekend (10/25-26) and saw nothing was traded.
- It used to work.
- there was no power outage nor internet disconnect during that time.
- MC version - MultiCharts64 Version 12.0 Release (Build 18184)
- I B API version - Build 976.2d, Apr 30, 2019 11:29:28 AM
-Windows 64, 7 Pro
Folks, any ideas?

User avatar
Svetlana MultiCharts
Posts: 645
Joined: 19 Oct 2017
Has thanked: 3 times
Been thanked: 163 times

Re: I B weekend disconnect and their server maintenance used to auto-reconnect but now it does not

Postby Svetlana MultiCharts » 13 Feb 2020

Hello, quantum777

We would like to offer several tips for this situation:

1) At first let us post the alternatives to restarting TWS:
a) Use IB gateway application.
It doesn’t shut down once in 24 hours.
IB gateway application provides access to IB API only, it has no trading interface (sending orders, symbol, price, account information are not available in it).
In order to use IB gateway application you need to do the following changes:
In the quote manager please go to Tools->Data sources->IB->Settings.
Uncheck the option “Launch TWS at start” and input the port IB gateway application uses.

b) Avoid Interactive brokers TWS from shutting down once in 24 hours.
In TWS please go to the Configure->Lock and exit->Set auto log off time.
Set the time before the current time.
In this case TWS will wait for the next day to shut down.
Next day you can repeat the procedure.

c) There is a tool over the Internet called "TWS Start" that starts TWS automatically for you.
You will need to search online for more info about it.

You can increase the timeout for disabling the auto-trading in MultiCharts.
In MultiCharts please go to File tab->Broker profiles->Manage->IB->Edit.
Here you can see the option: Disable auto trading after NNNNN seconds.
You can input the value equal almost up to 24 hours (=86400 seconds).
In this case MultiCharts will not disable auto trading for NNNNN seconds.
You will need to start TWS during this timeout period to continue trading.

2) You can add traces in your code (print, fileappend) to clearly see the values that the script operates with and monitor its behaviour.
A general example is available in our wiki:
https://www.multicharts.com/trading-sof ... t_Executed
In this article you can find just the examples. Only the script writer knows which values shall be traced in the code to analyze its operation.

3) Useful information about trading activity is stored in the Order and Position Tracker:
https://www.multicharts.com/trading-sof ... on_Tracker
If your auto trading was unattended for some time you may find the answers there when come back.

4) When you have opportunity, connect remotely to the computer where auto trading us running to check if everything works as expected.

5) If you notice the issue again please send us more detailed report via the main MultiCharts window -> Help -> Feedback.
In the description please answer the following questions:
Do you use IB Gateway or TWS?
Was IB application working when you notice the issue?
Was the clock in the bottom right corner of MultiCharts ticking?
Was information in the Order and Position Tracker updating when you notice the issue?
Was IB broker profile connected in MultiCharts?
Were any orders generated after start of auto trading? Do you see them in the Order and Position Tracker-> Orders tab?
Were any orders sent to IB when auto trading was unattended?
Were any orders rejected or cancelled?
If you closed MultiCharts, were all MultiCharts processes finished by themselves in Task Manager?

Please select the options:
Attach a screenshot;
Attach log files…;
Upload collected data to help desk;
uncheck other options and click Send.


Return to “MultiCharts”