I'm stuck in my code. I would like to add sound alert file directory and not sure how.
Thanks
namespace NinjaTrader.Indicator
{
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
[Description("Enter the description of your new custom indicator here")]
public class VolEnglfV1 : Indicator
{
#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
#endregion
/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
Add(new Plot(new Pen(Color.Blue, 2), PlotStyle.Bar, "Englf_Volume"));
Add(new Plot(new Pen(Color.Gray, 2), PlotStyle.Bar, "Volume"));
Add(new Line(Color.DarkGray, 0, "Zero line"));
CalculateOnBarClose = false;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (CurrentBar<3)
return;
if (Volume[0] > Volume[1])
{
Values[0].Set(Volume[0]);
Values[1].Reset();
{PlaySound("Alert1.wav");}
}
else
{
Values[1].Set(Volume[0]);
Values[0].Reset();
}
}
#region Properties
[Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries Plot0
{
get { return Values[0]; }
}
#endregion
}
}
Comment