READ-ONLY

The forum is now a read-only archive.

For bug reports & platform questions → [email protected]

Our community lives on Discord and YouTube — come join us!

MQL4 Simple request that i’m trying to do, please help..!

3 replies

Karish

Customer, bbp_participant, community, sq-ultimate, 414 replies.

Visit profile

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

Customer, bbp_participant, community, sq-ultimate, 414 replies.

Visit profile

10 years ago #136860

Somebody please..?

0

kapitalgo

Customer, bbp_participant, community, 28 replies.

Visit profile

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

Customer, bbp_participant, community, sq-ultimate, 414 replies.

Visit profile

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)