Symbol Properties in Strategy Tester--spread

 
I wish to know how to set the correct spread value in the Symbol Properties within the Strategy Tester. The broker I use has the spread set to zero for all currencies, which invalidates any test runs. It doesn't seem to be high on their priority list of things to get done, so I'm enquiring if there is anything I can do to set the spreads to correct values, so my tests can be closer to reality. (If it takes developing a program/routine, I will be able to do it.) If it has to be done by the broker, please post the instructions, and I will forward them, so that at least they don't have to figure it out.
 
i agree and also wish to know how to do it. including the actual spread is absolutely vital to backtesting.

see also the threads:

"Change Symbol Properties such as spread in strategy tester"

and

"Changing symbol properties?"

where is this 'TestHistoryHeader'? are you relating to fxt files? if yes, how do we edit these fxt files? i get gibberish in an ASCII browser.
 
davidwt,

i wonder if a possible solution would be to add/subtract a variable to the Ask, Bid, Takeprofit, and Stoploss terms in your Order functions. this way, everything would be shifted in the way a real spread does.

you would define this variable as extern double for your startup screen, and put in a 0 when you trade live/demo, and the actual spread of your broker when you do backtesting.

just an idea.

i ran my expert for a few days and then backtested to calibrate. i am finding that the overall outcome is similar, but the exact trades are taken at somewhat different prices, which makes it harder to discern the exact effect of spread=0 in the backtesting. i have not backtested at the tick level.
 
I did both think about your suggestions and made an initial attempts at faking the spread; but its not easy, nor can I cover all possible consequences. The hardest is initiating a market order at the Ask price, when its further then the slippage + Bid. There is no clean way around this without affecting my testing.
 
Support @ MetaQuotes:
I really need a response or help in this.
 
I did both think about your suggestions and made an initial attempts at faking the spread; but its not easy, nor can I cover all possible consequences. The hardest is initiating a market order at the Ask price, when its further then the slippage + Bid. There is no clean way around this without affecting my testing.


You wouldn't initiate at the Ask/Bid price. You would initiate at the price you normally use, and then add/subtract the spread to the Ask/Bid price in your SendOrder() command.

But I am also confused whether Ask/Bid prices in Strategy Tester are really not different with spread=0 in Symbol Properties. Or is this only an additional spread to the default in live demo trading and we are fine?

Metaquotes Support please help - we need some clarifications and solutions urgently.
 
When I say initiate an order, it is using OrderSend(). For it to be realistic, a buy has to be done at a realistic Ask price, and if the quotes are at the Bid price, then it won't take the market order if the slippage is not large enough.

Yes, it is really zero spread, with Bid == Ask. You can test this out with the following expert (do not use optimization as it doesn't allow Print output):

int start()
{
	//Print(CurTime(),",",Bid,",",Ask);
	Print("Bid ",Bid," Ask ",Ask," Spd ",(Ask-Bid)/Point," Dff ",(Ask-Bid));
	return(0);
}
 
When I say initiate an order, it is using OrderSend(). For it to be realistic, a buy has to be done at a realistic Ask price, and if the quotes are at the Bid price, then it won't take the market order if the slippage is not large enough.

Yes, it is really zero spread, with Bid == Ask. You can test this out with the following expert (do not use optimization as it doesn't allow Print output):

int start()
{
	//Print(CurTime(),",",Bid,",",Ask);
	Print("Bid ",Bid," Ask ",Ask," Spd ",(Ask-Bid)/Point," Dff ",(Ask-Bid));
	return(0);
}




Thank you, that is helpful. Does your broker have variable spread? If yes, I don't see what you can do for realistic scenario anyway (change broker). If not, shouldn't inserting the spread in SendOrder and setting the slippage higher help? I have the slippage fairly high anyway and never had a problem with my strategies.
 
Thank you for your suggestions, bubo. There is still much difference between a 2-5 pip spread (even if it is fixed in backtesting) and slipped (from slippage) orders.

I appreciated the suggestions, but I want a solution to the backtesting using zero spreads for some brokers. If there is a real way to fix this of my own accord without accomodation of my scripts, I would appreciate knowing. If not, then please post instructions that can be past onto the brokers so they know how to fix it.

Support personnel?
 
we've found problem with interbank fx symbol settings. workaround of this problem in the test generator coming soon
 
Thank you, Slawa. I am really looking forward to the fixes as I really like your Strategy Tester.
Reason: