I receive Connecting and Connected Emails but no Disconnection email.
Below is my code:
protectedoverridevoid OnConnectionStatus(ConnectionStatus orderStatus, ConnectionStatus priceStatus)
{
if (dataFeed == ConnectionStatus.ConnectionLost)
{
SendMail("[email protected]", "[email protected]", "Connection to Order Server Lost!", "Please verify that the server's internet connection is still valid");
PlaySound(@"C:\Program Files\NinjaTrader 7\sounds\Alert4.wav");
}
if (dataFeed == ConnectionStatus.Connecting)
{
SendMail("[email protected]", "[email protected]", "Connecting", "Trying to reestablish Order Server connection");
PlaySound(@"C:\Program Files\NinjaTrader 7\sounds\Alert4.wav");
}
dataFeed = orderStatus;
if (dataFeed == ConnectionStatus.Connected)
{
SendMail("[email protected]", "[email protected]", "Connected", "Check that strategy is active");
PlaySound(@"C:\Program Files\NinjaTrader 7\sounds\Alert4.wav");
}
}
Comment