Log files monitor

Questions about MultiCharts and user contributed studies.
User avatar
larssan
Posts: 61
Joined: 26 Feb 2011
Location: Sweden
Has thanked: 8 times
Been thanked: 8 times

Log files monitor

Postby larssan » 07 Dec 2011

Hi,

I auto trade with MC on a server and looking for a way to monitor that everything is running as it should.

The easiest way to do that, that I know of is using a log file monitoring software search the log files and have a e-mail or sms sent whenever it finds any errors.

My question is if anyone knows what to search for in the log files, and in which log files ?

What I want to track is:

1. Automate Order Execution: OFF
2. Automate Order Execution: ON
3. Connectivity to broker (Disconnected)
4. Connectivity to broker (Reconnected)
5. Connectivity to data feed (Disconnected)
6. Connectivity to data feed (Reconnected)
7. Change in active orders
8. Change in market positions

What would be feasible to use as a search word or string for each of the possible actions above ?

I would appreciate if you have any other ideas of what to track...
Or maybe someone knows a better way to achieve the same result.

Thanks, Lars

User avatar
Katrin Yanenko
Posts: 55
Joined: 28 Nov 2011
Has thanked: 18 times
Been thanked: 23 times

Re: Log files monitor

Postby Katrin Yanenko » 08 Dec 2011

Hi Lars,

Connectivity to data feed (Disconnected)
Connectivity to data feed (Reconnected) - these can be found in tsServer log files (%USERPROFILE%\Local\AppData\Local\TS Support\MultiCharts\7.4.4846.200\Logs\tsServer).

Connectivity to broker (Disconnected)
Connectivity to broker (Reconnected)
Change in active orders
Change in market positions - these can be found in TradingServer log files (%USERPROFILE%\Local\AppData\Local\TS Support\MultiCharts\7.4.4846.200\Logs\ TradingServer).

Please mind that the location might be changed in next versions.

Automate Order Execution: OFF
Automate Order Execution: ON - this information can be called from the script by keyword getappinfo(aistrategyauto).

User avatar
larssan
Posts: 61
Joined: 26 Feb 2011
Location: Sweden
Has thanked: 8 times
Been thanked: 8 times

Re: Log files monitor

Postby larssan » 10 Dec 2011

Thanks Katrin.

Do you know if it's possible to also have a script check for the connectivity of data feed and broker ?

Then I could skip the log files search and only use a script for all occurrences.
That might be easier...

Thanks, Lars

User avatar
Katrin Yanenko
Posts: 55
Joined: 28 Nov 2011
Has thanked: 18 times
Been thanked: 23 times

Re: Log files monitor

Postby Katrin Yanenko » 12 Dec 2011

Dear Lars,

Unfortunately, it is not possible to check the connectivity of data feed and broker by the script. You can find this information only in the logs.

Best regards, Katrin

User avatar
larssan
Posts: 61
Joined: 26 Feb 2011
Location: Sweden
Has thanked: 8 times
Been thanked: 8 times

Re: Log files monitor

Postby larssan » 12 Dec 2011

Do you know what to search for in the log files ?
What I've found so far is:

Connectivity to broker (Disconnected)
IB: m_connection_checker.isConnected == false
OEC: OnDisconnected: Unexpected= 0

Connectivity to broker (Reconnected)
IB: m_connection_checker.isConnected == true
OEC: Connection to Open E Cry has been established

Connectivity to data feed (Disconnected)
IB: Connectivity between IB and TWS has been lost
OEC: CancelMarketData

Connectivity to data feed (Reconnected)
IB: Market data farm connection is OK
OEC: Connection is OK

Change in active orders
IB:
OEC: PlaceOrder

Change in market positions
IB:
OEC: OrderFill

Cancelling orders
IB:
OEC: Order Cancelling

Do you think this would work or should I look for other text strings ?
Is there a way to see if the active orders and positions are Long or Short ?

Also, is there a way to see in the log files if the Automate Order Execution is turned on or off ?
I think it would be best to use either the log files or a script for all...

Regards, Lars

User avatar
Katrin Yanenko
Posts: 55
Joined: 28 Nov 2011
Has thanked: 18 times
Been thanked: 23 times

Re: Log files monitor

Postby Katrin Yanenko » 14 Dec 2011

Hi,

These strings that you have found should work fine.
You can also see whether the current position is Long or Short in the TradingServer_Trace.txt in TradingServer folder.
There are lines as:
SetPosition m_MP=1, _broker_mp=1

SetPosition m_MP=-1, _broker_mp=-1

and
Position updated: ..........; MP=1;

User avatar
c0ntango
Posts: 70
Joined: 13 Sep 2018
Has thanked: 3 times
Been thanked: 16 times
Contact:

Re: Log files monitor

Postby c0ntango » 25 Jan 2021

Hi Everyone,

I know I'm going to develop a reputation of resurrecting some long-dead threads. This one is 10 years old but just as relevant today as it was back then. :-)

My question, especially to MC staff but maybe someone else knows something too:

Once you detect the connection has been dropped (personally I print a heartbeat from a script on a chart and check the file from another computer and alert if the interval between the heartbeats is too large) ...

Is there an executable, like tsserver.exe or tradingserver.exe or lmaxserverhost.exe or whatever else, that could be sent a "restart" command on the process level to reinstate the feed, instead of having to restart the whole platform?

I'm hoping somebody has solved this issue in one way or another... The data feed does tend to die every now and then. I don't blame MC, I have written FIX API connectors and I know what it takes to make it stable, it can't really be done properly, especially with the holiday breaks, etc. The only way is to observe it from the outside, and let a watchdog restart it when it dies. It's not amazing. But I'm thinking maybe we could do the same thing here. At least it would solve the stability issue without having to restart the platform itself.

Please let me know your thoughts!

-Ben


Return to “MultiCharts”