Wait, so you want to boost your risk if your account goes under the account high watermark? That's a sure way to blow cash as soon as your egy is not working well and leave it to the table once the egy is in tune with the market. Just saying.

Initial thought in your code:
Your code is only going to work during that 1 case of the EA. If you restart it, then you reset the large watermark to whatever the balance is at the time in the new case.