API Support Forum
OEC API > API Support > Identifying which server you are connected to...
Author Topic: Identifying which server you are connected to...
(2 messages, Page 1 of 1)
Moderators: VPfau
PDavies541
Posts: 21
Joined: Feb 01, 2013


Posted: Jun 17, 2013 @ 05:53 AM             Msg. 1 of 2
Hi

I have some code that is called from an indicator. It uses the API but it doesn't make the connection itself, it uses the connection that the OEC client creates.

How can I tell if we are currently connected to a live or demo server?

Thanks

Pete

Peter Davies
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Jun 24, 2013 @ 05:06 PM             Msg. 2 of 2
We just added a new property - "Environment". You need to compare its value with "PROD". All other values will point to simulation environments. Something like that:

if(OEC.API.OECClient.Global.Properties["Environment"] == "PROD")
{
// live actions
}

Victor Vins
Lead Software Developer