You can assign a time variable and compare it later to calculate the time difference and then delete the draw object. A sample code will be like:
inn Variables
bool onlyOnce = true; DateTime lastDrawTime;
if (onlyOnce && BarsInProgress == 0 && Open[0] == Close[0])
{
this.DrawHorizontalLine("DojiLong", High[0], Color.Blue);
onlyOnce = false;
lastDrawTime = Time[0].AddMinutes(15);
}
if (!onlyOnce && BarsInProgress == 0 && Time[0] > lastDrawTime)
{
RemoveDrawObject("DojiLong");
onlyOnce = true;
}

Comment