Clarification Of Spread In FXT Editor (How to Calc Spread)

General discussion about the Tickstory Lite software package.
Post Reply
Trader2384
Posts: 75
Joined: Sun Jul 07, 2013 3:24 pm

Clarification Of Spread In FXT Editor (How to Calc Spread)

Post by Trader2384 »

Hi,

What unit is the number listed in the "Spread" field of Metatrader FXT Editor in Tickstory? I'm confused because, when I change the value to 2, it says "(0.2 Pip)" next to it. So I figured in order to get 2 pips spread a value of 20 needs to be entered. However, if we keep the value of 2 listed and the launch mt4 from Tickstory and run a backtest, the spread value listed in the test results says "Spread Current (2)" and not 0.2?! I'm confused. Please see screenshots below. Does 2 entered in FXT Editor actually mean 2 pips or does it mean 2 points?
2 spread in mt fxt editor.png
spread equals 2.png
Thank you :)

This question is based topic http://tickstory.com/forum/viewtopic.ph ... 0702#p2160

tickstory
Posts: 4899
Joined: Sun Jan 06, 2013 12:27 am

Re: Clarification Of Spread In FXT Editor (How to Calc Sprea

Post by tickstory »

Hi Trader 2384,

The spread value of in MT4 is expressed in Points. This is because "pips" as we know it is dependent also on the number of "digits" the broker has (i.e. whether it supports fractional digits or not).
Here is some code that will help demonstrate the point and let you confirm that the actual test values are as you expect:

Code: Select all

      // SpreadDivider is used to calculate whether the spread should be divided by 10 to get the "pip" spread
      int spreadDivider = (Digits % 2 == 1) ? 10:1;
      Print("Spread (Ask-Bid): " + DoubleToStr(Ask-Bid));
      Print("Spread (expressed in Points): " + MarketInfo(Symbol(),MODE_SPREAD));
      Print("Spread (Pips): " + DoubleToStr(MarketInfo(Symbol(),MODE_SPREAD) / spreadDivider));
On a 5-digit instrument, you would be expecting your Ask-Bid to be 0.00002 if your spread was set to 0.2 pips.

There is some discussion on MT4 forum threads that discuss this concept more.

Hope this helps.

Trader2384
Posts: 75
Joined: Sun Jul 07, 2013 3:24 pm

Re: Clarification Of Spread In FXT Editor (How to Calc Sprea

Post by Trader2384 »

Interesting - that code helps a lot. Thank you!

So just to confirm - for a 5-digit broker on a 5-digit currency pair like EURUSD, entering the number "2" in strategy tester spread box means 2 points or 0.2 pips?!

Is there a way to tell in mt4 the number of "digits" the broker has?

tickstory
Posts: 4899
Joined: Sun Jan 06, 2013 12:27 am

Re: Clarification Of Spread In FXT Editor (How to Calc Sprea

Post by tickstory »

Correct - "2" on a 5-digit broker means 0.2 pips (as the Tickstory UI shows).
In Metatrader MQL language, you can use "Digits" to determine how many digits a symbol has.

Regards.

Trader2384
Posts: 75
Joined: Sun Jul 07, 2013 3:24 pm

Re: Clarification Of Spread In FXT Editor (How to Calc Sprea

Post by Trader2384 »

great, thanks!

Post Reply