@paihdt You can remove both 'once per bar' blocks 40 and 41. They are unnecessary. Then you need a condition block below blocks 33 and 37 comparing the current value of lot size with that maximum you want. Depending on the result that same lot size variable is modified accordingly.