I am trying to remove some lines I had created before with RemoveDrawObject but it seems it doesn't work.
For example the line can be created after the order is working
if (order.OrderState == OrderState.Working)
{
IHorizontalLine buyLine = DrawHorizontalLine(order.Name, order.LimitPrice, Color.DarkBlue);
}
And removed when the order is filled
if (order.OrderState == OrderState.Filled)
{
RemoveDrawObject(order.Name);
}
While the creation works fine, I don't see the removal process. I have tried to unlock the buyLine but that didn't help (buyLine.Locked = false)
I have also tried this suggested in the link below without success.
How can I manage to remove these lines, otherwise they keep accumulating?
Thanks for your help
Comment