MQL4 Simple request that i’m trying to do, please help..!
3 replies
Karish
10 years ago #115106
Im trying to make the money management function to work like so:
if the balance is increase the lot will increase as well,
BUT
when the balance decreasing the lot will stay the same if it already was bigger and not by the current account balance as it is working right now..
please if you can help me out on this one 🙂
double getLotsRiskPercentage(double slSize) {
if(RiskInPercent <0 ) {
Log("Incorrect RiskInPercent size, it must be above 0");
return(0);
}
double riskPerTrade = (AccountBalance() * (RiskInPercent / 100.0));
return(computeMMFromRiskPerTrade(riskPerTrade, slSize));
}
Thank you for your time and effort.
0
Karish
10 years ago #136860
Somebody please..?
0
kapitalgo
10 years ago #136882
have you tried it with AccountEquity(), like
double riskPerTrade = (AccountBalance() * (RiskInPercent / 100.0));
if (AccountEquity() < AccountBalance()) {
return(Lots);
} else {
return(computeMMFromRiskPerTrade(riskPerTrade, slSize)); }

Not tested! Greets
0
Karish
10 years ago #136925
have you tried it with AccountEquity(), like
double riskPerTrade = (AccountBalance() * (RiskInPercent / 100.0)); if (AccountEquity() < AccountBalance()) { return(Lots); } else { return(computeMMFromRiskPerTrade(riskPerTrade, slSize)); }
Not tested! Greets
Thank you for your time buddy, already solved it though :), godbless
0
Viewing 3 replies - 1 through 3 (of 3 total)