There are no compiler errors from the editor.
The file name of the indicator is the same as that inside the code.
I am new to this so maybe it's obvious - any thoughts?
----------------------------------------
region Using declarations
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Gui;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Gui.SuperDom;
using NinjaTrader.Gui.Tools;
using NinjaTrader.Data;
using NinjaTrader.NinjaScript;
using NinjaTrader.Core.FloatingPoint;
using NinjaTrader.NinjaScript.DrawingTools;
using NinjaTrader.NinjaScript.Indicators;
#endregion
public class CustomVolumeATRIndicator : NinjaTrader.NinjaScript.Indicators.Indicator
{
private NinjaTrader.NinjaScript.Indicators.ATR atr;
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name="ATR Period", Description="Number of bars for ATR calculation", Order=1, GroupName="Parameters")]
public int AtrPeriod { get; set; }
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name="Font Size", Description="Size of the displayed text", Order=2, GroupName="Parameters")]
public int FontSize { get; set; }
[NinjaScriptProperty]
[XmlIgnore]
[Display(Name="Text Color", Description="Color of the displayed text", Order=3, GroupName="Parameters")]
public Brush TextColor { get; set; }
[Browsable(false)]
public string TextColorSerializable
{
get { return Serialize.BrushToString(TextColor); }
set { TextColor = Serialize.StringToBrush(value); }
}
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name="Volume Divisor", Description="Value to divide volume by", Order=4, GroupName="Parameters")]
public int VolumeDivisor { get; set; }
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = "Displays (Volume / VolumeDivisor) / ATR vertically above each candle";
Name = "CustomVolumeATRIndicator";
Calculate = Calculate.OnBarClose;
IsOverlay = true;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
// Set default values for the new properties
AtrPeriod = 1;
FontSize = 10;
TextColor = Brushes.White;
VolumeDivisor = 1000;
}
else if (State == State.Configure)
{
atr = ATR(AtrPeriod);
}
}
protected override void OnBarUpdate()
{
if (CurrentBar < AtrPeriod)
return;
double volumeComponent = Volume[0] / (double)VolumeDivisor;
double atrValue = atr[0];
if (atrValue > 0)
{
double result = volumeComponent / atrValue;
Draw.Text(this, "VolumeATR" + CurrentBar, true, result.ToString("F2"), 0, High[0] + TickSize, 90, TextColor,
new SimpleFont("Arial", FontSize), TextAlignment.Center, Brushes.Transparent, Brushes.Transparent, 1);
}
}
}

Comment