All of the EAs that we program at OneStepRemoved.com generally use one of three types of  money management.  I don’t really like that term, though.  I believe  that position sizing formula is generally more accurate.
 Fixed Lot Size Use a percentage of available margin Lose a certain percentage of the account balance whenever the stop loss is hit. Most MetaTrader users are accustomed to using fixed lots.  It’s far  and away the most common method found in commercial EAs.  If you’ve  watched any of the videos on this site or spoken with me, you know that I  generally have a low opinion of most commercial EAs.  Just because  everyone does it does not mean that it’s a good idea!
 Whenever a customer order mentions the idea of using a Risk input to  control the lot size, it typically means to use a selected percentage of  the available margin.  Say, for example, that you trade a $10,000  account on 1% margin (100:1 leverage) and want to use 2% of available  margin on any given trade.  If you have no open positions, then the  margin to use is $10,000 * 2% = $200.
 The lot size is the outcome of the following formula:
Lots = Margin to Use / Margin Required per standard lot
 Going back to our example, you simply plug in the numbers:
$200 / $1000 per standard lot (100:1 margin) = 0.2 lots, which is 2 mini lots.
 The MQL4 code for this is
double lots = (AccountFreeMargin() * Risk) / MarketInfo( Symbol(), MODE_MARGINREQUIRED);
 The advantage to this method is that the lot size remains consistent  barring a dramatic change in available margin.  I don’t actually see  that as an advantage, but many traders like seeing the same lot size on  most trades.  
 The disadvantages are numerous.  If you like to trade on high  leverage and trade many different instruments, you can easily get  yourself into a margin call.  If your strategy calls for placing a stop  based on price action, the amount lost will vary depending on where the  stop is placed.  Some trades might lose $20 while others lose $100.  
 double lots = Risk * AccountEquity() / MarketInfo(Symbol(), MODE_TICKVALUE) / Stop;
 My favorite method is to select my lot size based on the equity loss  if my stop is hit.  If I risk 0.5% on a $10,000 account and my stop loss  is 20 pips away, then desired lot size is
lots = 0.5% * $10,000 / $10 per tick per standard lot / 20 pips = 0.25 lots, or 2.5 mini lots
 The lot size decreases whenever the stop loss distance increases, and  vice versa.  A 60 pip stop loss would require a lot size of
lots = 0.5% * $10,000 / $10 per tick per standard lot / 60 pips = 0.083 lots, or 0.8 micro lots after accounting for rounding.
 The varying lot size drives most traders crazy.  I believe such  rationale ignores the logic of trading.  Trading is a statistical  outcome, a distribution of events that theoretically returns a net  result greater than zero.  We call this profit in daily life.  
 If your trading system is x% accurate and you know the profit factor  is greater than 1, why on earth a trader would haphazardly bet different  dollars amount on every trade is beyond me.  The effect is no different  than randomly choosing to bet $10 on this trade and $100 on the next.   The random, system-less method of choosing position sizes for your  trading system would overwhelm the nice, even distribution that you’re  expecting from the signals.