not sure why
// 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 HH7Alert : Strategy
{
#region Variables
// Wizard generated variables
private int period1 = 7; // Default setting for Period
private int barcounter = 0;
// User defined variables (add any user defined variables below)
private WinTrace myWinTrace ;
#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;
myWinTrace = new WinTrace ("MyWINID", "My trace window");
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
///
protected override void OnBarUpdate()
{
// Do not calculate if we don't have enough bars
if (CurrentBar < period1) return;
if (FirstTickOfBar)
barcounter++;
// Get a sum of prices over the specified period
double sum = 0;
int hh7bar = 0;
// loop for HH7
for (int barsAgo = 0; barsAgo < period1; barsAgo++)
{
if ( Range()[barsAgo] >= Range()[0] )
{
hh7bar = barsAgo;
}
}
// HH7 plotting
if (hh7bar==0)
{
//DrawDot("HH7"+barcounter.ToString(), true, 0, Low[0] - (4*TickSize), Color.DarkRed);
//BackColor = nr7color;
//send alert to me
Print("HH7" + Instrument.FullName, "HH7" + hh7bar.ToString());
}
}
}

Comment