How to do compounding in an EA?

 
Hi, I'd like to know how to do this. I tried to use OrderSend and on the lots input I wrote AccountBalance() / 200. But after 3 or 4 trades on backtesting appeared a bug, it bought the maximum lots it could buy. So what should I do for compounding?
 

The equation I've used from day one is:

double Lots=0.1; double Profit_F=0.00002;
Lots=NormalizeDouble((AccountEquity()*Profit_F),1);
Still works for me :)
 
ubzen:

The equation I've used from day one is:

Still works for me :)

Hmm why do you write Lots = 0.1 if you're gonna redefine it differently next? Shouldn't it be


Lots = Lots + NormalizeDouble((AccountEquity()*Profit_F), 1);
 
I just like my method so that when I do a back-test for the first time and don't know what the Profit Factor is, I use the minimum fixed lot of 0.1. Ps. Your method would accumulate the lots faster than heck. Thats not what compounding is about. You should be more concerned about risk than just stacking up the lots.
 
ubzen:
I just like my method so that when I do a back-test for the first time and don't know what the Profit Factor is, I use the minimum fixed lot of 0.1. Ps. Your method would accumulate the lots faster than heck. Thats not what compounding is about. You should be more concerned about risk than just stacking up the lots.

hmm I'm still a begginner, I'm not quite understanding. Where do you take Profit_F value from? And can you explain when do you use 0.1 lots?