As a strategy the code works great.
I can't make it work as an indicator.
(BoxTime & BoxSize are declared for the indicator just like the strategy)
All of the code I inserted (outside the indicator wizard) is shown below.
It displays nothing when deployed / enabled as indicator.
No errors at deployment on chart, no errors during compile.
MUCH thanks in advance.
Sean
protected override void Initialize()
{
CalculateOnBarClose = false;
Overlay = true;
DrawOnPricePanel = true;
}
protected override void OnBarUpdate()
{
if (Open[0] < Close[1])
{
RemoveDrawObjects();
DrawRectangle("DownBox", false, BoxTime, Low[0], -4, Low[0] + BoxSize * TickSize, Color.IndianRed, Color.IndianRed, 2);
}
if (Open[0] > Open[1])
{
BoxSize = BoxSize * -1;
RemoveDrawObjects();
DrawRectangle("BoxUp", false, BoxTime, High[0], -4, High[0] - BoxSize * TickSize, Color.PaleGreen, Color.PaleGreen, 2);
}
}
Comment