I am trying to develop an indicator on a 60min chart with some additional criteria on the daily chart. With the current code I am able to get it to plot and though a signal on the daily chart but not on a 60min chart which is what I am looking for. Any help would be greatly appreciated. Thanks so much, Ryan.
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "GapDown2percent";
Calculate = Calculate.OnEachTick;
IsOverlay = false;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
//Disable this property if your indicator requires custom values that cumulate with each new market data event.
//See Help Guide for additional information.
IsSuspendedWhileInactive = true;
AddPlot(Brushes.Blue, "Signal");
}
else if (State == State.Configure)
{
AddDataSeries(Data.BarsPeriodType.Day, 1);
}
}
protected override void OnBarUpdate()
{
{
if (CurrentBar < 5)
return;
if (
//Gap down 2%
Opens[1][1] < (Closes[1][2] * .98) &&
//Gap down clearing yesterdays Low
Opens[1][1] < Lows[1][2] &&
Closes[0][0] < Highs[1][1]
)
{
Draw.ArrowUp(this, "MyArrow" + CurrentBars[0], true, 0, Lows[0][0] - (2 * TickSize), Brushes.RoyalBlue);
Value[0] = 1;
}
else
{
Value[0] = 0;
}
}
}
Comment