Example : (i want to code it more easy)
var: lastPos(0);
if (marketposition<>lastPos) then begin
//do instruction
end:
lastPos=marketposition;
var: lastPos(0);
if (marketposition<>lastPos) then begin
//do instruction
end:
lastPos=marketposition;