Originally Posted by Qw3rty
I would like to reset the counter or Lot size to 1 for a specific condition when Equity has reached a new high by $X.
Your code is not measuring Equity. Use Zorro's Equity variable to check for new maximums. Ideally, this should be a global variable or static var.

If you declare var Count inside of run, Zorro will forget its value every time another bar arrives. So don't do that. This should also be a global variable or static var.

Originally Posted by Qw3rty
What I am trying to achieve is when a trades loses I increase the lot size BUT if the trade wins I might want to increase the lot size depending on if the Equity has reached a new high by X dollars.
All trades are losing from the moment they are entered because of commission and spread, so you need establish a better definition of "losing trade". You're not monitoring this.

Did you know that that your code is generating a bad Count and simply increasing/decreasing the position by that much? You really have no idea what your position is because your code is clearly not tracking it at all.

Originally Posted by Qw3rty
The above is sample code
It's not clear how much you're leaving out intentionally. But at the end of the day, it looks nothing like what you are describing.