I added a zero line to ninja 8 Slow Stochastics and it works so I tried the same kind of code to a line for TSI and it doesn't. You'll see it right after the TSI line is drawn.
Here's the TSI section involved. I renamed the indicator so I could still plot a TSI on charts until I get it fixed.
I'm also uploading the way I did on the Stoch just changing 50 to 0.
public class TSIme : Indicator
{
private double constant1;
private double constant2;
private double constant3;
private double constant4;
private Series<double> fastEma;
private Series<double> fastAbsEma;
private Series<double> slowEma;
private Series<double> slowAbsEma;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDescriptionTSI;
Name = "TSIme";
Fast = 3;
IsSuspendedWhileInactive = true;
Slow = 14;
AddPlot(Brushes.DarkCyan, NinjaTrader.Custom.Resource.NinjaScriptIndicatorNameTSI);
AddLine(Brushes.Yellow, 0, NinjaTrader.Custom.Resource.NinjaScriptIndicatorZero);
}
else if (State == State.Configure)
{
constant1 = (2.0 / (1 + Slow));
constant2 = (1 - (2.0 / (1 + Slow)));
constant3 = (2.0 / (1 + Fast));
constant4 = (1 - (2.0 / (1 + Fast)));
fastAbsEma = new Series<double>(this);
fastEma = new Series<double>(this);
slowAbsEma = new Series<double>(this);
slowEma = new Series<double>(this);
}
}
protected override void OnBarUpdate()

Comment