How to backtest an EA using fixed lot trades without getting stopping out

 

I opened an account a few months ago with a broker that uses MT4.

However I need to backtest my EAs using a fixed lot in each trade.

I usually do this to find the true volatility that an EA can capture from a FX market. If it works and the equity curve looks well then I apply money management optimizing the lot size per trade.

Here is my problem:

Given that I opened a real trade account with a small amount of money, when I run some EA that start with lossing trades, the EA stops running because of a Stop Out.

It usualy happens when I backtest EAs in high time frames like daily or weekly bars.

MT4 by default comes with 2 EA as example: "Moving Average" and "MACD sample". If you check their codes, both EAs use the function "AccountFreeMargin()" to determinates if there is enough money in the account to launch a trade order.

In other words, it seems that given that my real account doesnt have enough money I can not do any backtesting for long periods, or with EAs that start running with big Equity drawdowns.

Is there any way to set in the EA code a "virtual Huge Free margin" to be able to run any kind of EAs?

Best regards

Hernan

 

I'm not working with live accounts yet so I'm not sure if this would work for you. Worth a try tho. In the strategy tester's window, there's a button in the upper right side which says Expert Properties, click that and check the Testing Tab. You should be able to change the Initial Deposit to whatever you want.

 

If that doesn't work for you then try Downloading Meta_Trader Demo from another Broker with similar Setting as your Live Broker. You can also look into creating a dummy/disconnected terminal. Hope that helps. 

 
hcova:

Is there any way to set in the EA code a "virtual Huge Free margin" to be able to run any kind of EAs?

What's the difference between a 'virtual Huge Free margin' to simply running the Test with a bigger initial deposit? Why don't u just do that?
 
gordon:
What's the difference between a 'virtual Huge Free margin' to simply running the Test with a bigger initial deposit? Why don't u just do that?

The solution to this is stated by Ubzen. Change virtually your initial deposit with a huge value in the Expert Properties button.

Thanks ubzen

 
hcova:

The solution to this is stated by Ubzen. Change virtually your initial deposit with a huge value in the Expert Properties button.

Which is what I said...
Reason: