Disliked{quote} What is profit? Is it built-in function or variable? My solution is: double ProfitOpenPos; ProfitOpenPos = GetProfitOpenPos(); if(ProfitOpenPos > 0) { ObjectCreate("CD16", OBJ_LABEL, 0, 0, 0); ObjectSetText("CD16", "Profit: " + DoubleToStr(ProfitOpenPos, 2), 20, "Arial Black", Aqua); ObjectSet("CD16", OBJPROP_CORNER, 1); ObjectSet("CD16", OBJPROP_XDISTANCE, 10); // 105 ObjectSet("CD16", OBJPROP_YDISTANCE, 130); } else { ObjectCreate("CD16", OBJ_LABEL, 0, 0, 0); ObjectSetText("CD16", "Profit: " + DoubleToStr(ProfitOpenPos, 2), 20, "Arial...Ignored
Profit comes from GetProfitOpenPos() function, same as your example.
It works but the problem now is that colors do not reset.
1