I created am Indicator for Ploting the maximum and minimum prices traded over a period of time.
I am having an issue with the High and Low values from the price series which seems to ignorre the candle tails, using only the open and close values as highs and lows. (see capture)
I have tried this with data captured live from an Apex connection and from a Ninjatrader Live Connection on 2 different instruments.
Is it possible that the price series is wrong?
Am I wrong with what High and Low data series should represent?
Can you please tell me if this is an error in my coding?
My goal is to capture the top and bottom tails.
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "RangeMaxMin";
Calculate = Calculate.OnBarClose;
IsOverlay = true;
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;
AddTicks = 0;
RangeBars = 10;
AddPlot(Brushes.SeaGreen, "Upper");
AddPlot(Brushes.OrangeRed, "Lower");
}
else if (State == State.Configure)
{
max = MAX(Low,RangeBars);
min = MIN(High, RangeBars);
}
}
protected override void OnBarUpdate()
{
//Add your custom indicator logic here.
double max0 = max[0];
double min0 = min[0];
Upper[0] = max0 + AddTicks * TickSize;
Lower[0] = min0 - AddTicks * TickSize;
}

Comment