I copied the SMA indicator and was modifying it to make a new indicator as below and on compiling get following errors. I think I replicated the required definitions - can you please tell me where I went wrong. TIA suraj.
Ps is there an easier way for me to post the NinjaScript compiler text and error messages than I have done manually? thanks.
----
Modified indicator snippet:
public class DPO : Indicator
{
private double priorSum;
private double sum;
private double nPeriod;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
50Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDe scriptionDPO;
51 Name = NinjaTrader.Custom.Resource.NinjaScriptIndicatorNa meDPO;
IsOverlay = true;
IsSuspendedWhileInactive = true;
Period = 20;
nPeriod = 0;
57 AddPlot(Brushes.Goldenrod, NinjaTrader.Custom.Resource.NinjaScriptIndicatorNa meDPO);
AddLine(Brushes.DarkGray, 0, NinjaTrader.Custom.Resource.NinjaScriptIndicatorZe roLine);
}
else if (State == State.Configure) ....
.........
-----------
errors flagged on compiling:
for lines 50 and 51 I get error CS0117 (per Google– 'type' does not contain a definition for 'identifier' This occurs when you are trying to call a method or use a property on an instance of an object, but there is no method or property with that name}
and the column flagged is after Custom.Resource. NinjaScriptIndicatorDescriptionDPO and NinjaScriptIndicatorNameDPO
of course line 57 gets flagged because compiler did not recognize NinjaScriptIndicatorName in line 51

Comment