I am trying to display a level or HorizontalLine in an indicator panel in a strategy. The level is to be changed from within the strategy.
I am using the ConstantLines indicator to draw the level in the panel.
However, when I try to adjust the line level from the strategy the line does not visibly change, except when the strategy is restarted.
Where rThreshold holds the level to be displayed, the code in the strategy is
ConstantLines(rThreshold, 0, 0, 0).Line1Value = rThreshold;
This changes the Line1Value of the indicator.
In the ConstantLines indicator we have
protected override void OnBarUpdate()
{
if (Line1Value != 0) Line1.Set(Line1Value);
......
so, on each bar update, the plotted level ( Line1 series) of the line should reflect the value in Line1Value.
However it does not. I have searched other threads and tried all the solutions I have found but none have worked so far. Has anyone a definite solution?


Comment