For myTS and myTS1 etc in on barupdate it has "identifier expected" as the code error. I am not seeing anything on the timespan in ninja 8. Also on line 70 (after int minutes 4) it says it says type or namespace definition or end of file expected. Any ideas the correct method? Thanks.
public class TimerIndicator : Indicator
{
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "TimerIndicator";
Calculate = Calculate.OnBarClose;
IsOverlay = false;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
private TimeSpan myTS;
private TimeSpan myTS1;
private TimeSpan myTS2;
private TimeSpan myTS3;
private TimeSpan myTS4;
//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;
}
else if (State == State.Configure)
{
}
}
protected override void OnBarUpdate()
{
myTS = Time[0] - Time[1];
myTS1 = Time[1] - Time[2];
myTS2 = Time[2] - Time[3];
myTS3 = Time[3] - Time[4];
myTS4 = Time[4] - Time[3];
int minutes = ((int)myTS.TotalMinutes) + (myTS.Seconds > 30 ? 1 : 0);
int minutes1 = ((int)myTS1.TotalMinutes) + (myTS1.Seconds > 30 ? 1 : 0);
int minutes2 = ((int)myTS2.TotalMinutes) + (myTS2.Seconds > 30 ? 1 : 0);
int minutes3 = ((int)myTS3.TotalMinutes) + (myTS3.Seconds > 30 ? 1 : 0);
int minutes4 = ((int)myTS4.TotalMinutes) + (myTS4.Seconds > 30 ? 1 : 0);
}
}
}

Comment