Thanks!
// 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 HSICrossover : Strategy
{
#region Variables
// Wizard generated variables
// 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 OnBarUpdate()
{
// Condition set 1
if (CrossAbove(Close, WMA(Close, 13), 1))
{
PlaySound(@"C:\Program Files\NinjaTrader 6.5\sounds\Alert3.wav");
DrawText("Crossover" + CurrentBar, "Crossover", 0, 0, Color.Red);
Log("Crossover occurred", LogLevel.Information);
}
}
#region Properties
#endregion
}
}
Comment