I could modify an indicator to write elements (i) to a list with conditions I need.
But I do not understand from this basic indicator how to remove elements with a condition. The lines in the indicator are
for (int i = myList.Count -1; i >= 0; i--)
{Print ("Event # "+ i + " Occured on bar: " + myList[i]);
if (i < myList.Count - 10)
{RemoveDrawObject("mydot" + myList[i].ToString()); myList.Remove(myList[i]);}
When I modify with the condition I need this doesnt work and the line is not removed.
for (int i = myList.Count -1; i >= 0; i--)
{Print ("Event # "+ i + " Occured on bar: " + myList[i]);
if (i > Closes[1][0])
{RemoveDrawObject("mydot" + myList[i].ToString()); myList.Remove(myList[i]);}
Can anyone help me with this code to remove elements from the list eg with "if CrossAbove (SMA(8), SMA(20), 1))" then RemoveDrawObject.
Thank you!
Tony

Comment