Highlight a bar;
Place a marker on the chart; and
Play a sound
When Certian conditions occur. I do not get an error, but I do not get any markers, painted bar or sound.
Where did I go wrong?
---------------------
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
///<summary>
/// This indicator will paint a bar, make a sound, place a marker
///</summary>
[Description("This indicator will paint a bar")]
publicclass PaintBar : Indicator
{
#region Variables
// Wizard generated variables
privateint myInput0 = 1; // Default setting for MyInput0
// 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>
protectedoverridevoid Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
CalculateOnBarClose = true;
Overlay = true;
PriceTypeSupported = false;
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
if (Close[0] > Close[1])
BarColor = Color.Pink;
DrawTriangleUp("MyTriangleUp", 0, Low[0] - 2 * TickSize, Color.Red);
PlaySound(@"C:\Program Files\NinjaTrader 6.5\sounds\Alert1.wav");
Comment