// 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 volume : Strategy
{
#region Variables
// Wizard generated variables
private int volume1 = 50000; // Default setting for Volume1
private int volume2 = 30000; // Default setting for Volume2
private int volume3 = 20000; // Default setting for Volume3
private int volume4 = 10000; // Default setting for Volume4
// 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 = false;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (Volume[0] > Volume1)
{
Alert("MyAlert72", Priority.High, "", @"C:\Program Files\NinjaTrader 7\sounds\TNA vol 1.wav", 1, Color.White, Color.Black);
}
// Condition set 2
if (Volume[0] > Volume2)
{
Alert("MyAlert73", Priority.High, "", @"C:\Program Files\NinjaTrader 7\sounds\TNA vol 2.wav", 1, Color.White, Color.Black);
}
// Condition set 3
if (Volume[0] > Volume3)
{
Alert("MyAlert74", Priority.High, "", @"C:\Program Files\NinjaTrader 7\sounds\TNA vol 3.wav", 1, Color.White, Color.Black);
}
// Condition set 4
if (Volume[0] > Volume4)
{
Alert("MyAlert75", Priority.High, "", @"C:\Program Files\NinjaTrader 7\sounds\TNA vol 4.wav", 1, Color.White, Color.Black);
}
}
#region Properties
[Description("")]
[GridCategory("Parameters")]
public int Volume1
{
get { return volume1; }
set { volume1 = Math.Max(1, value); }
}
[Description("")]
[GridCategory("Parameters")]
public int Volume2
{
get { return volume2; }
set { volume2 = Math.Max(1, value); }
}
[Description("")]
[GridCategory("Parameters")]
public int Volume3
{
get { return volume3; }
set { volume3 = Math.Max(1, value); }
}
[Description("")]
[GridCategory("Parameters")]
public int Volume4
{
get { return volume4; }
set { volume4 = Math.Max(1, value); }
}
#endregion
}

Comment