Bid/Ask Spread

Report any bugs with the Tickstory Lite software here. Please give as much detail as possible so the issue can be identified and resolved as soon as possible.
Post Reply
jinxbhoy
Posts: 4
Joined: Mon Dec 10, 2012 6:30 pm

Bid/Ask Spread

Post by jinxbhoy »

Hi there,

Iam having a prob with Bid/Ask spread after exporting data to MT4. I have used Tickstory expert to get broker data. All went fine Spread was set at 7 (0.7 pips), however during backtesting I got results with Bid/Ask spread of as much as 60 pips. Any idea what went wrong ?
Secondly, could please clarify fields of Base comm, Comm type, Comm lots from Metatrader Info tab pls ?

Thanks,

jinxbhoy

admin
Site Admin
Posts: 99
Joined: Thu Jul 19, 2012 9:17 am

Re: Bid/Ask Spread

Post by admin »

Hi jinxbhoy,

Can you please confirm that you are not connected to your broker while doing the back-test? Otherwise your spreads will be overridden by your broker.
Regarding the "60" pips - if you are using the MT4 function

Code: Select all

MarketInfo(Symbol(),MODE_SPREAD);
It will return a value of 60 which denotes a 6 pip spread on a 5-digit broker.

Regarding Commission Types, essentially this is the way that the commissions are calculated by the broker. A brief description taken from the FXT file format taken from http://codebase.mql4.com/source/2684:

//---- commission calculation
//---- basic commission type
COMM_TYPE_MONEY 0
COMM_TYPE_PIPS 1
COMM_TYPE_PERCENT 2

//---- commission per lot or per deal
COMMISSION_PER_LOT 0
COMMISSION_PER_DEAL 1

Generally speaking you should not need to change any of these values that have been acquired from your broker.

Regards.

stuomally
Posts: 5
Joined: Sun Feb 03, 2013 11:01 am

Re: Bid/Ask Spread

Post by stuomally »

Hi Admin,
I am new to the forum and would like to start by saying thanks for providing a means to loading tick data from Dukascopy in such a fast and efficient manner.
A great time saving tool that I appreciate !

I am having a similar experience to what jinxbhoy describes above in his post. I also have loaded a config file for my broker into Tickstory on the MetaTrader info tab, prior to exporting tick data into my MT4 platform. I can see the spread on this tab reflects my brokers last spread of .3 pip. I then export the data expecting the spread will be .3 pip (I guess this means you load the ask .3pip away from the bid as the ticks are loaded into the .fxt file). I then launch the MT4 platform from Tickstory (Note I have disconnected from the broker well prior to this). I then expected to see a value of .3 pip in the MODE_SPREAD variable when running backtests, however it shows a value of 2 full pips, and consequently i have to be at least this far (plus the slippage of another 2 pips) away from the ask when I place a pending order - otherwise i get a 130 error. I was hoping that the .3 pip would be reflected in the MODE_SPREAD as it clearly affects how and when I place my order/get filled. Is it your intention to load the MODE_SPREAD with that loaded from the config file ?

And without being a pain I noticed some earlier discussion around the fact that BIRT has engineered a way to allow MT4 to process .fxt files larger than 2GB. Do you think it may be on your radar to accomplish similar at some point ? That would solve just about everything to do with the drama's around tick data.

One other thing that you may or may not be aware of, is that backtesting is much faster when volume data is removed (or alternatively every tick is loaded with the same value in the volume field as that appears to trick it). I mean it runs about 10 times as fast. Do you provide a way to remove volume (or load with the same value using tickstory) ?

Once again , thankyou for your efforts to date and i look forward to your response.

-- UPDATE. Instead of assuming that you loaded Ask prices a certain number of points away from the Bid (ie I was expecting .3pips given the config file value for EURUSD), I printed out both the MODE_SPREAD and Ask - Bid, and they both showed 2 pips. Is it possible that the .3 pip loaded into the MetaTrader info tab via the config file isnt playing any part whatsover - ie the field that contains this value is a little broken ?

Regards
Stu

admin
Site Admin
Posts: 99
Joined: Thu Jul 19, 2012 9:17 am

Re: Bid/Ask Spread

Post by admin »

Hi stu,

- Regarding the back-testing spread, that is correct - the config file will determine what the MODE_SPREAD function will return for that particular symbol. The fact that you are getting a 2 pip spread is a little curious as happens to be the default spread that is set up in Tickstory. It could be that your broker's 0.3 pip spread isn't been applied correctly. To double-check, please try:
- Select the symbol you wish to export, right-click -> Export To MT4.
- In the "Metatrader Info" tab, Load your broker config.
- Now, in the Symbol properties, select the symbol you are about to export (for example, EURUSD). You should see 0.3 pips as the spread.
- Export your data.
- When you back-test, the MODE_SPREAD function should now return the 0.3 pip spread for the symbol you exported.

Your "new feature" suggestions are addressed in your separate topic:

http://www.tickstory.com/forum/viewtopic.php?f=4&t=111

Kind regards.

stuomally
Posts: 5
Joined: Sun Feb 03, 2013 11:01 am

Re: Bid/Ask Spread

Post by stuomally »

Hi admin,

Thankyou for your quick response.

Unfortunately the steps you detail are exactly the steps I have been taking - and yet still getting a spread of 2 pips when launching MT4 from Tickstory.
Nevertheless I tried again, and made sure to observe the .fxt file being built by Tickstory (observed its created date), and again ran tester in MT4 watching the .fxt to ensure that it wasnt recreated by MT4. Ie esuring that the patch was doing its job. Unfortunately, same result -- 2 pips for both the ModeSpread , and calcuating Ask - Bid. I am using a version of MT4 that is v4 build 4.5.1 so I dont believe that is the issue. It also confirms that the patch has been applied at the top of the MT4 platform after being launched from Tickstory so all good there.
Im using Tickstory 0.7.0.0 which I believe to be the latest.

Any idea's ?

Thanks again
Stu

admin
Site Admin
Posts: 99
Joined: Thu Jul 19, 2012 9:17 am

Re: Bid/Ask Spread

Post by admin »

Hi stu,

Could you please provide some additional information to see whether it's possible to identify the issue:

- Could you please confirm that your terminal is not connected to a broker?
- Could you please provide a screenshot of your 'Data Export' and 'Metatrader info' tab just prior to your export (please ensure the symbol you are exporting is selected on the 'Metatrader info' tab).
- Could you please give the snippet of code you are using to print out the spread.

Hopefully we can get to the bottom of your issue.

Thanks!

stuomally
Posts: 5
Joined: Sun Feb 03, 2013 11:01 am

Re: Bid/Ask Spread

Post by stuomally »

Hi Admin,

I have tried to document and upload but ..... it doesnt seem like i can upload just about any file type I can think of ... .docx .doc .htm .pdf

What file type can i upload ?

Kind regards
Stu

admin
Site Admin
Posts: 99
Joined: Thu Jul 19, 2012 9:17 am

Re: Bid/Ask Spread

Post by admin »

Hi Stu,

Apologies, I have enabled document uploading in this forum section. Could you please try again?

Thanks!

stuomally
Posts: 5
Joined: Sun Feb 03, 2013 11:01 am

Re: Bid/Ask Spread

Post by stuomally »

Hi Admin,

Please find details in attachment.

Cheers
Stu
Attachments
Issue with incorrect Spread.docx
(617.42 KiB) Downloaded 1205 times

admin
Site Admin
Posts: 99
Joined: Thu Jul 19, 2012 9:17 am

Re: Bid/Ask Spread

Post by admin »

Hi Stu, thanks for the comprehensive details. From your screenshots I cannot see any issue with what you're doing, however I also cannot reproduce the issue using either Build 432 or 451. When specifying the 0.3 pip spread on the export, the same code yields 0.3 pips during the back-test.

I can only assume at this stage that the 2 pip spread is coming from the symbols.sel file (you can verify this by selecting "Symbol properties" from the Strategy Tester menu), although not sure why at this point. If you connect to your broker, does your spread change to your broker spread? Could you also please let us know the O/S you are using?

Thanks.

Post Reply