PDA

View Full Version : MQL4 Calculate Profit (gain) from Highest Drawdown



oxrtadarcaymeltran
04-02-2017, 04:19 AM
Hello People,

I'm stuck with something which seems to be a rather simple task - that will help me out?

Let's assume Numerous places will be opened using an Account Beginning Balance of 1000:The drawdonwn of these open trades reduces equilibrium to 100 (Drawdown of 900) before the Account equilibrium again rises to 600 (profit from Highest Drawdown = 500). How do I code to acquire the above mentioned 500 Profit (gain) from Highest Drawdown)?

What I did so far:
Inserted Code if(AccoutEquityPriorCurrentRoundgt;AccountEquity() ) { if(MaxDDCurrentRound lt; AccoutEquityPriorCurrentRound-AccountEquity()) MaxDDCurrentRound = AccoutEquityPriorCurrentRound-AccountEquity(); //MaxDDCurrentRound is always zero or greater (positive amount).
With the understanding from the aforementioned MaxDDCurrentRound I want to have MaxGainFromHighestDDthisRd. This is where I'm stuck.

Inserted Code if(MaxGainFromHighestDDthisRd lt; TheValueWhichNeedsToBeCalculatedHere)) MaxGainFromHighestDDthisRd = TheValueWhichWasCalculatedRightAboveFromHere);