unfortunately it does not seems to be working, no email when lost connection. Anyone can look at the code below?
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
/// <summary>
/// Enter the description of your strategy here
/// </summary>
[Description("Enter the description of your strategy here")]
public class CONNECTION : Strategy
{
#region Variables
// Wizard generated variables
private int myInput0 = 1; // Default setting for MyInput0
private ConnectionStatus dataFeed = ConnectionStatus.ConnectionLost;
// User defined variables (add any user defined variables below)
#endregion
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnOrderUpdate(IOrder order)
{
if (dataFeed != ConnectionStatus.ConnectionLost)
{
// email when connectionlost
SendMail("[email protected]", "[email protected]", "lost connection", "lost connection");
}
}
protected override void OnConnectionStatus(ConnectionStatus orderStatus, ConnectionStatus priceStatus)
{
dataFeed = priceStatus;
}
Comment