Ok. The variables have different names in Zorro, so a formula equivalent to yours would look like this:

Lots = Balance/100*riskpercent/(Stop/PIP)/PIPCost;

But the normal method is to set a trade investment by Margin, and a maximum trade risk by Risk, like this:

Margin = Balance/100*riskpercent;
Risk = Balance/100*riskpercent;

The lot amount is then automatically reduced to not exceed the given risk. Finally, when you want to reinvest your balance, definitely check out the Money Management tutorial on the link I posted above. Money management is not trivial and a simple method as in your formula will unnecessarily reduce your profit and increase your risk. The percentage to reinvest is not up to you, it depends on the strategy and must be calculated from the equity curve. The same goes for the initial capital.

If you do not understand something with the tutorial or manual, just let me know what it is. I'm the tutorial guy, so it's my job to help with those questions.