MoneyManagement by L.Williams
Anybody tried out Larry Williams MM formula as described in his book "Long-Term Secrets for Short-Term Trading"
(Account Balance x Risk Percentage) / largest loss.
Helps control drawdown while simultaneously allowing safer compounding. He says that once you get over 13% on the risk percentage, "...drawdown increases faster than the increases in profit."
try MQL4 code
Code:
extern double Lots = 1;
extern double MMRisk = 0.05; // Risk Factor
extern double LossMax = 3200; // Maximum Loss by 1 Lot
void start()
{
double Lotsi = MoneyManagement (Lots, MMRisk, LossMax);
}
//----------------------------------------------------------------
double MoneyManagement (double Lots, double risk, double maxloss)
{
double MinLots=NormalizeDouble(MarketInfo(Symbol(),23),2);
double LotStep=NormalizeDouble(MarketInfo(Symbol(),24),2);
double MaxLots=NormalizeDouble(MarketInfo(Symbol(),25),2);
int LotDigit;
if (LotStep==1) { LotDigit=0; }
if (LotStep==0.1) { LotDigit=1; }
if (LotStep==0.01) { LotDigit=2; }
double Lotsi=Lots;
double MAXloss=maxloss;
Lotsi=NormalizeDouble(Lots*AccountEquity()*risk/MAXloss,LotDigit);
if (Lotsi<MinLots) Lotsi=MinLots;
if (Lotsi>MaxLots) Lotsi=MaxLots;
return(Lotsi);
}