How can i Know the minimum Balance needed for EA to run smoothly without MarginCall ?

 

Hello

I am new to developing EAs

I am developing an EA that Has Sort of Martingale in it so sometimes it goes to high drawdowns in equity but most of the times eventually close in profit

after looking at the test report i cannot figure what is the minimum balance needed for the ea to run smoothly without getting stopped out - margin call 

plus withdrawing any profits regularly when they occur and keep the balance the same as it when it started trading ?



edit : this a 5 year backtest on M5 TF

from the report there is absolute drawdown of 111$ but it never happened in the graph, why? is this in equity? then why the equity curve didn't show it?

and the Maximal DrawDown is 5593.21 i didn't see any drop that huge in the graph either in equity or balance qurve!!


I hope you understand my question i have searched the forum for similar question but i couldn't understand why there is a difference between the graph and report

thanks

 
AhmedMorra:

Hello

I am new to developing EAs

I am developing an EA that Has Sort of Martingale in it so sometimes it goes to high drawdowns in equity but most of the times eventually close in profit

after looking at the test report i cannot figure what is the minimum balance needed for the ea to run smoothly without getting stopped out - margin call 

plus withdrawing any profits regularly when they occur and keep the balance the same as it when it started trading ?

edit : this a 5 year backtest on M5 TF

from the report there is absolute drawdown of 111$ but it never happened in the graph, why? is this in equity? then why the equity curve didn't show it?

and the Maximal DrawDown is 5593.21 i didn't see any drop that huge in the graph either in equity or balance qurve!!

I hope you understand my question i have searched the forum for similar question but i couldn't understand why there is a difference between the graph and report

thanks

You are just not reading your graph properly.

  • Absolute DD, in your case is right at the beginning but is not obvious because of the scale of the final chart.
  • Maximal DD and Relative DD is based on Equity drawdown, not Balance drawdown.
  • In the graph, equity DD is not always clear, because equity can change drastically during the life-span of an order, but on graph, you only see closing equity or during opening of other orders. This can be confusing and that is why some users implement their own graph of equity separately to see real equity chart. There may be code in the CodeBase for outputting equity to Offline Charts for this purpose. I remember there being something like that long time ago, but I don't remember the name. You will have to do a search.
 
Fernando Carreiro:

You are just not reading your graph properly.

  • Absolute DD, in your case is right at the beginning but is not obvious because of the scale of the final chart.
  • Maximal DD and Relative DD is based on Equity drawdown, not Balance drawdown.
  • In the graph, equity DD is not always clear, because equity can change drastically during the life-span of an order, but on graph, you only see closing equity or during opening of other orders. This can be confusing and that is why some users implement their own graph of equity separately to see real equity chart. There may be code in the CodeBase for outputting equity to Offline Charts for this purpose. I remember there being something like that long time ago, but I don't remember the name. You will have to do a search.

so the minimum amount i should deposit in the account depends in the Maxima DD, did i get that right?

 
AhmedMorra: so the minimum amount i should deposit in the account depends in the Maxima DD, did i get that right?

Not so easy to answer. Martingale and Grid type strategies are very dangerous, and you have to study the mathematics of Martingale/Grid strategies to know your minimum balance required.

You cannot just use back-test as reference, because a much larger number of consecutive losses can happen in other situations, and it is up to you to know the math of your strategy and what is possible in so you can prepare for it.

I don't know your strategy so I cannot help give you a mathematical formula for calculating it.

However, here is example of results of Martingale (doubling of volume), from another thread on subject:

Forum on trading, automated trading systems and testing trading strategies

Martingale, Hedging and Grid : MHG

Fernando Carreiro, 2017.09.05 01:59

On a Cent account, your gains are also in cents and therefore 100 times less that normal accounts but still limited by the same maximum number of lots that brokers allow (many have a limit of 100 Lots and many others a limit of 50 Lots).

The following table for a normal account shows how quickly it can "blow" your balance, trading for example on EUR/USD or GBP/USD or many other xxx/USD currency pairs:

Consecutive Martingale Orders
Lots
10 pips loss
100 pips loss
1
0.01
$1.00
$10.00
2
0.02
$2.00
$20.00
3
0.04
$4.00
$40.00
4
0.08
$8.00
$80.00
5
0.16
$16.00
$160.00
6
0.32
$32.00
$320.00
7
0.64
$64.00
$640.00
8
1.28
$128.00
$1,280.00
9
2.56
$256.00
$2,560.00
10
5.12
$512.00
$5,120.00
11
10.24
$1,024.00
$10,240.00
12
20.48
$2,048.00
$20,480.00
13
40.96
$4,096.00
$40,960.00
14
81.92
$8,192.00
$81,920.00
Max Lots (on many brokers)
100.00
$10,000.00
$100,000.00
PS! Actually my table is conservative, because losses are cumulative, so actual values are double the losses shown on this table!
So, draw your own conclusions!!!
 
Fernando Carreiro:

You are just not reading your graph properly.

  • Absolute DD, in your case is right at the beginning but is not obvious because of the scale of the final chart.
  • Maximal DD and Relative DD is based on Equity drawdown, not Balance drawdown.
  • In the graph, equity DD is not always clear, because equity can change drastically during the life-span of an order, but on graph, you only see closing equity or during opening of other orders. This can be confusing and that is why some users implement their own graph of equity separately to see real equity chart. There may be code in the CodeBase for outputting equity to Offline Charts for this purpose. I remember there being something like that long time ago, but I don't remember the name. You will have to do a search.

Thank you for the information, here is the "Equity recorder" you mentioned:

https://www.mql5.com/en/code/9343

Equity Recorder
Equity Recorder
  • www.mql5.com
I often see people post "equity" curves from the backtester, showing only smooth lines and ignoring any drawdown between opening and closing a trade. Since MetaTrader only plots a new datapoint in the equity plot when a trade is closed, you simply can not get realistic plots. Also the time is completely missing, the x axis shows the number of...
Reason: