Difference between the broker's swap and the MQL swap

 
Am a newbie in Forex programming.I want to test carry trading strategy,so
opened a demo account in Alpari,
the problem is when I checked some currencies with coding,got something too far different from what the site says.
here is what I've written:

DoubleToStr(Point,5)
DoubleToStr(MarketInfo(Symbol(),MODE_SWAPLONG),4)
DoubleToStr(MarketInfo(Symbol(),MODE_SWAPSHORT),4)
and the result for GBPUSD is:
---------------------------
testproject GBPUSD,H1
---------------------------
symbol: GBPUSD
Point :0.00001
swap long :-0.1000
swap short:-2.8000
---------------------------
But alpari says :https://alpari.com/en/rollover_interest/
GBPUSD -0.012 pips -0.358 pips

Have i missed something?
 
brazandeh:
Am a newbie in Forex programming.I want to test carry trading strategy,so
opened a demo account in Alpari,
the problem is when I checked some currencies with coding,got something too far different from what the site says.
here is what I've written:

and the result for GBPUSD is:
---------------------------
testproject GBPUSD,H1
---------------------------
symbol: GBPUSD
Point :0.00001
swap long :-0.1000
swap short:-2.8000
---------------------------
But alpari says :https://alpari.com/en/rollover_interest/
GBPUSD -0.012 pips -0.358 pips

Have i missed something?

Hi brazandeh,

Don't forget MarketInfo (Symbol(), MODE_SWAPTYPE) and read this article https://www.mql5.com/en/articles/1512.

:D

 
onewithzachy:

Hi brazandeh,

you forget MarketInfo (Symbol(), MODE_SWAPTYPE).

:D


When I ran
MarketInfo (Symbol(), MODE_SWAPTYPE).
got zero,So how can I interpret the aforementioned info?
 
brazandeh:

When I ran got zero,So how can I interpret the aforementioned info?
MetaEditor > Navigator window Ctrl + D > Dictionary tab > Standards Constant > Market info look for MODE_SWAPTYPE.
 
brazandeh:

When I ran got zero,So how can I interpret the aforementioned info?

That means points . . . not " 1 - in the symbol base currency; 2 - by interest; 3 - in the margin currency. "

MarketInfo

 
RaptorUK:

That means points . . . not " 1 - in the symbol base currency; 2 - by interest; 3 - in the margin currency. "

MarketInfo

ok according to the documentations,it means Poins.
---------------------------
testproject GBPUSD,H1
---------------------------
symbol: GBPUSD
Point :0.00001
swap long :-0.1000
swap short:-2.8000
---------------------------
But alpari says :https://alpari.com/en/rollover_interest/
GBPUSD -0.012 pips -0.358 pips

swap long in programing =-0.1000
Broker site =-0.012
how can I get the broker's swap with programing?
 

You have to ask AlpariUK to explain that - they regulated anyway, so they better have some explanation about it. I have AlpariUK acc, however I've never have any rollover interest on my trades.

:D

 
Maybe it was a weekend thing . . . it might match today . . .
 
Thank you guys,I mailed them, and will share the answer with you
 

Hi again

Here's their answer:

Thank you for your email and detailed data.

I understand what you are querying and I can provide you the following information.

Alpari UK tries to provide the same trading environment on demo accounts as well as on live accounts.

However, it can occur that some data do not match like the one you have pointed out.

I have investigated this issue with IT and we will update the swap fee information on this demo server.

It should be aline with the next update for tomorrow’s swap fees.

I checked my demo account yesterday and seemed everything okay.

 

Yep, I just check swap on EURUSD on my live and demo and Alpari UK site, Everything are the same now. Wow, you're a hero, brazandeh. Thanks for brought this up then.

:D

Reason: