Strategy Tester spread (again)

 
Ok, I've read a bunch of posts in this forum about how the strategy tester uses the spread from your broker. Looks to be true as my backtests this weekend showed 9/10 pip spreads on the GBPUSD/EURUSD which matched what was in my Market Watch window. Will we be allowed to specify the spread explicitly in the future? Not sure why the spreads from Fri were so wide but my only option was to remove the symbols.sel file to set the spread to 0 (which obviously isn't that good of an idea) or hack it somehow to put the spreads where I want them.
 
Same here...tried the fxt file formats, but could never find the right place to change the spread...

Slawa, any help?
 
Same here...tried the fxt file formats, but could never find the right place to change the spread...

Slawa, any help?


I haven't tried yet but I would think you could hack the symbols.sel file to set a bid/ask pair with the desired spread. As long as you're not connected and receiving quotes I would think it would stick. Haven't spent any time looking at the format of the symbols.sel file though -- as of right now I'm trying to code my own backtester.
 
Same here...tried the fxt file formats, but could never find the right place to change the spread...

Slawa, any help?

I am not Slawa, however see:
"struct TestHistory in fxt" and
"importing tick data to history center"
for header values.
 
Dear Sub,

:) Thank you! OK, finally found the right byte to modify through your thread ("struct TestHistory in fxt"). So, here is step-by-step guide to change the spread value...

1. Download HEX editor (XVI) from http://www.programmersheaven.com/zone16/cat862/21568.htm
2. Open the fxt file of interest for your currency pair using HEX editor
Location: Meta Trader 4\Tester\History directory
File Name Format: SSSSSSPP_M.fxt, e.g. EURUSD60_0.fxt, EURUSD15_1.fxt or CHFJPY1440_2.fxt
M - indicates type of data model used, 0 - Every tick, 1 - Control Points, 2 - Open prices only
3. Look for 6th row. In the right hand side window, you should see the currency name preceded by @, e.g. for EURUSD, you should see @EUR or for CHFJPY, you should see @CHF.
4. Now, in the same row, last but one column in the central window (with all hex codes) is the cell that contains the spread.
5. Manually edit this value to reflect the spread offered by your broker
6. Save the fxt file and close it
7. Now, in MetaTrader terminal, under strategy tester, select the currency pair for which you changed the spread value
8. Click on Symbol properties to confirm that the spread change has been reflected

Phew! This was bugging me for all this time...finally, resolved! :)
 
Dear Sub,

:) Thank you! OK, finally found the right byte to modify through your thread ("struct TestHistory in fxt"). So, here is step-by-step guide to change the spread value...

1. Download HEX editor (XVI) from http://www.programmersheaven.com/zone16/cat862/21568.htm
2. Open the fxt file of interest for your currency pair using HEX editor
Location: Meta Trader 4\Tester\History directory
File Name Format: SSSSSSPP_M.fxt, e.g. EURUSD60_0.fxt, EURUSD15_1.fxt or CHFJPY1440_2.fxt
M - indicates type of data model used, 0 - Every tick, 1 - Control Points, 2 - Open prices only
3. Look for 6th row. In the right hand side window, you should see the currency name preceded by @, e.g. for EURUSD, you should see @EUR or for CHFJPY, you should see @CHF.
4. Now, in the same row, last but one column in the central window (with all hex codes) is the cell that contains the spread.
5. Manually edit this value to reflect the spread offered by your broker
6. Save the fxt file and close it
7. Now, in MetaTrader terminal, under strategy tester, select the currency pair for which you changed the spread value
8. Click on Symbol properties to confirm that the spread change has been reflected

Phew! This was bugging me for all this time...finally, resolved! :)


With that does it then ignore the value in Market Watch or is it added on?
 
This replaces the value from Market Watch...
 
This replaces the value from Market Watch...

PS: Also, the row number depends on the size of your XVI window...so, row 6 might not always be true nor might be the last but one column....ouch! I tested it on my laptop and then opened the HEX file on my home computer's 19" monitor and everything was in different place...well, I guess, I'll create screen shots of each pair to show where the spread is and post it as image files...


On your XVI, go to Tools>Options>Appearance, and set number of rows and columns for your data format.

You should always give HEX address rather than row/column coordinates.
 
Dear Sub,

That's smart! Thank you! :) The HEX address is 7C (you can see this address at the bottom-left corner of XVI editor)...

This was some quest... :)