Alert As Object

 

Can someone help explain why this does not work?

extern int AccountWarningLevel = 500;

int start()
{
double EquityMarginLevel = AccountStopoutLevel();

if (EquityMarginLevel < AccountWarningLevel)
{
ObjectCreate("Warning",OBJ_LABEL, 0, 0, 0);
ObjectSet ("Warning", OBJPROP_COLOR, Red);
ObjectSet ("Warning", OBJPROP_CORNER, 3);
ObjectSet ("Warning", OBJPROP_XDISTANCE, 50);
ObjectSet ("Warning", OBJPROP_YDISTANCE, 50);
ObjectSetText ("Warning", "Account Funding Warning", 20, "Veranda", Red);
}
else
{
ObjectDelete("Warning");
}
//----

//----
return(0);
}

 
richard1138:

Can someone help explain why this does not work?

It does work . . . maybe you can explain in what way you think it doesn't work ?