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: 22 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).
These users thanked the author Katrin Yanenko for the post (total 2):
JoshMlarssan

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: 22 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: 22 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;
These users thanked the author Katrin Yanenko for the post (total 2):
larssanJoshM


Return to “MultiCharts”