I haven't really checked your code to confirm whether the OnTick function has logic of updating the Position Size textfield value or not, I just assumed so since I faced the same issue when I was developing my MT5 version of MQLTA OCTP, if I put updating textfield value logic in OnTick function, the same issue would happen. I'm guessing this might be a bug in MT5 platform, maybe there is a conflict issue between ObjectSetString and CHARTEVENT_OBJECT_ENDEDIT event when they happen in same time. I don't really have an idea for the solution other than don't put updating value of user-editable-textfield logic in OnTick function (if you really put the logic there).