It's just a simple vol alert with sound....Thanks..V.
#region Using declarations
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.ComponentModel;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
#endregion
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
/// <summary>
/// Alerts you when there is a volume spike
/// </summary>
[Description("Alerts you when there is a volume spike")]
public class HighVolAlert : Indicator
{
#region Variables
// Wizard generated variables
private int MyInput0 = 1; // Default setting for Volume Alert
// 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()
{
CalculateOnBarClose = true;
Overlay = true;
PriceTypeSupported = false;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (CurrentBar < 1)
return;
if (Volume[0] > MyInput0)
DrawDiamond("HighVolume" + CurrentBar, 0, Low[0] - TickSize, Color.Gold);
if (Volume[0] > MyInput0)
PlaySound(@"C:\Program Files\Kirby Alarm\Trade Alerts\High Volume Alert.wav.");
}
#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]; }
}
[Description("")]
[Category("Parameters")]
public int Vol0
{
get { return MyInput0; }
set { MyInput0 = Math.Max(1, value); }
}
#endregion
}
}
Comment