The indicator plots when I add it to a chart and the value changes from -5,- +5 all the time, like it is supposed to. Is there something I am missing in the indicator development that I need to set in order to be able to call values from a strategy.
Indicator code
protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
Overlay = false;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
three_day_h = DonchianChannel(9).Upper[1];
five_day_h = DonchianChannel(15).Upper[1];
three_day_l = DonchianChannel(9).Lower[1];
five_day_l = DonchianChannel(15).Lower[1];
if (High[0] > five_day_h)
{
y = 5;
is_con = is_con + 1;
Print("High greater than 5 day high" + Time[0] + " of " + five_day_h.ToString());
}
else if (High[0] < five_day_h && High[0] > three_day_h)
{
y = 3;
is_con = is_con + 1;
Print("High greater than 3 day high" + Time[0]);
}
if (Low[0] < five_day_l)
{
y = -5;
is_con = is_con + 1;
Print("5 day low is " + five_day_l.ToString()+ " and current low is " + Low[0].ToString() + " at " + Time[0]);
}
else if (Low[0] > five_day_l && Low[0] < three_day_l)
{
y = -3;
is_con = is_con + 1;
Print(" 3 day low is " + three_day_l.ToString() + " " + Time[0]);
}
if (is_con > 1)
{
Print("We have a problem nasa " + Time[0]);
}
Plot0.Set(y);
Value.Set(y);
}

Comment