Spread used by strategy tester

 

spread used by strategy tester is very critical to an EA I am developing. Strategy tester uses the live spread if the market is open and when market is closed it uses closing spread based on the last bid and ask quoted by the broker. Some smart brokers even when their normal spread is like 1.5, will show closing quotes so that spread is something like 5, 10 or even more which is disastorous for optimization. During open market, if you do optimization, optimization will be based on continuously varying spreads which is not very healthy for ea. I looked up the issue in the forum and there was a thread in 2009 where there was a "Spread Generator" which is very difficult to use.

I would like to request someone from our brilliant community here to develop a mql4 callable function which can be used as follow in your EA when you are using strategy tester.

double spread;

spread = 2.5;

SetSTspread(Symbol(),spread); // ST is for strategy tester

If this function can reset the spread to be used by the strategy tester to whatever value you want, one can develop entire EA with a very fixed spread regardless of whether the market is open or closed.

This is something very simple to do for a high tech company like MetaQuotes but they have chosen to ignore the issue for whatever reason. I believe that this unstable spread used by the strategy tester is the main secret why backtesting results will not repeat themselves into live trading.

I am even willing to pay a decent fee if the developer wishes.

 
Just disconnect from your Broker . . then the Spread will never change.
 
RaptorUK:
Just disconnect from your Broker . . then the Spread will never change.

Thanks for the idea but problem is that if brokers market spread range is 0.5 to 1.5 pips, I would like optimize ea using spread = 2 or something like that.
 

@7325453863:

Hello, try downloading a demo version of a different MT4 terminal from a different broker. Possibly FXDD.

http://www.fxdd.com/us/en/accounts/open-a-demo-account/

Thank you.

 
WhooDoo22:

@7325453863:

Hello, try downloading a demo version of a different MT4 terminal from a different broker. Possibly FXDD.

http://www.fxdd.com/us/en/accounts/open-a-demo-account/

Thank you.


I already have a live account at FXDD for many years. Their spread for EURUSD is more or less in a small range like 1.7 to 2.3 but still it is variable and can go to 3,4 or 1.5. And FXDD is NFA regulated so they can offer only 50:1 leverage. Going to FXDD is like running away from real problem. For Metaquotes to give us a function to set spread in strategy tester is like a child's play for them but has not happened yet. I have been using MetaTrader for over 4 years now.
 

I've been trading using MT4 for about a year. I doubled my account balance twice using support & resistance for entries and exits. Also, I use proper money management. I manually trade, but have been coding some sick nasty strategies as of late. I respect your time of 4 years trading. Do you have any advice to share with me (trader to trader) ?

The seemingly most valuable lesson that I have learned in my year of trading is this...

I focus on trades that are in profit with supreme priority. I close partial orders when support/resistance levels are hit, then allow what is left of partial orders to run until "long-term" trend support/resistance is broken. I do not focus on losing trades, but focus on support and resistance levels. Trading for me is like running a marathon. It is a game of will and endurance.

Maybe you will find value in what I have written.

Thank you.

 
7325453863: For Metaquotes to give us a function to set spread in strategy tester is like a child's play for them but has not happened yet.
Or somebody else will. Here.
 
ubzen:
Or somebody else will. Here.

Thank you so much Ubzen! I downloaded and installed your script. Documentation is superb and the software is flawless. I just used it. It allows me to do exactly what I wanted to do. Everyone who develop an EA should use it. I was struggling with this issue for so long and wasted so much time. Backtesting results could not repeated with the same result without your software.
 
WhooDoo22:

I've been trading using MT4 for about a year. I doubled my account balance twice using support & resistance for entries and exits. Also, I use proper money management. I manually trade, but have been coding some sick nasty strategies as of late. I respect your time of 4 years trading. Do you have any advice to share with me (trader to trader) ?

The seemingly most valuable lesson that I have learned in my year of trading is this...

I focus on trades that are in profit with supreme priority. I close partial orders when support/resistance levels are hit, then allow what is left of partial orders to run until "long-term" trend support/resistance is broken. I do not focus on losing trades, but focus on support and resistance levels. Trading for me is like running a marathon. It is a game of will and endurance.

Maybe you will find value in what I have written.

Thank you.


I am happy to hear that you have been able to do in 1 year what I have not been able to do after 4 years, that is to make consistent and sizeable profit. I am not qualified to give you much advice except that I agree with pundits that controlling your losses is the key to winning.
 
7325453863:

Thank you so much Ubzen! I downloaded and installed your script. Documentation is superb and the software is flawless. I just used it. It allows me to do exactly what I wanted to do. Everyone who develop an EA should use it. I was struggling with this issue for so long and wasted so much time. Backtesting results could not repeated with the same result without your software.
You're welcome. However I cannot take credit for the script. The guy at mt4i is really generous.
 

@7325453863:

The first account I began trading with, I blew up the entire account balance. ;) I understood that I was not mentally ready to trade BEFORE I even began trading the "blown up" account. I simply agreed with myself that I would literally "blow up" the account balance trying to mentally become familiar with EUR/USD. I did all the wrong things, poor money management, bad trading entry/exit, etc. BUT, I learned a valuable lesson. This lesson was "experience" trading on a live account. I believe the reason why I am able to trade live is because I have "experience" losing an account balance while making INCREDIBLY POOR judgement. ;) When I created the next account I was "prepared" to make better judgement. I knew all along I would "blow up" my first account balance. I simply wished to "learn how to lose" properly and become familiar with the currency pair that I would be trading. I suppose I learned allot (and am still learning) from "making poor judgement" (experience). Yes, I believe money management is a key component to "long term" success and agree with you regarding this.

Thank you for your reply.

Reason: