# Swap calculation not consistent with what MT4 Order Windows shows?

111
2013.09.27 09:08

Hi,
I’m trying to calculate swaps in deposit currency, but the results do not seems to be consistent with whant MT4 shows in the Order windows (Swap column).

What does the Swap column show? The Swap is in Points or in Deposit Currency. (While you can choose what to display in the Profit Column, you cannot do it for the Swap column).

Let’s take following examples.

Rates at swap time:
EURNOK = 8.06442
Swap in points. MarketInfo(“EURNOK”,MODE_SWAPLONG) = -7.65 points
MT4 Swap column shows: = -7.65
Swap in Deposit Currency (EUR) should be:
-7.65 * TICKVALUE * Lots = -7.65*0.1240376 *1 = -0.9488878 EUR (correct?)

So, it seems that MT4 shows exactly the swap in points (I would expected to see it in deposit currency) and, to know the actual loss, I have to convert those 7.65 points in EUR which turns up to be less the 1 EUR: is that correct?

Now, let’s see this second example, which mess everything up:

Rates at swap time:
USDZAR = 9.98538 (EURUSD = 1.35027)
Swap in points. MarketInfo(“EURNOK”,MODE_SWAPLONG) = -22.69
MT4 Swap column shows: = -16.82
Swap in Deposit Currency (EUR) should be:
-22.69* TICKVALUE * Lots = -22.69*0.074865*1 = -1.6986 EUR (correct?)

This time seems that MT4 shows neither the swap in points (as per MarketInfo), nor the Swap in Euro, unless my calculations are wrong.

Last example, even more discouraging.
USDTRY = 2.0187 (EURUSD = 1.35027)
Swap in points. MarketInfo(“EURNOK”,MODE_SWAPLONG) = 2.85
MT4 Swap column shows: = 31.32
Swap in Deposit Currency (EUR) should be:
+2.85* TICKVALUE * Lots = 2.85*3.709336*1 = 10,57 EUR (correct?)

Can anyone show me what I’m doing wrong in either: 1 understanding what MT4 Swap column shows, 2 calculating the actual Swap in deposit currency?
Is anyone able to match the above numbers and make them consistent?

Thank you very much.
Stefano

549
2013.09.27 09:46
Did you check MarketInfo(Symbol(),MODE_SWAPTYPE) ?
111
2013.09.27 10:54

Did you check MarketInfo(Symbol(),MODE_SWAPTYPE) ?

111
2013.09.27 10:57

Hi,

thanks for the hint.

I did check (but only for one of the brockers) and it is 0. I've now checked also for the other brocker and actually it is 1.

Summing up, for the following SWAPTYPE is 1:

EURNOK = 8.06442
Swap in points. MarketInfo(“EURNOK”,MODE_SWAPLONG) = -7.65 points
MT4 Swap column shows: = -7.65
Swap in Deposit Currency (EUR) should be:
-7.65 * TICKVALUE * Lots = -7.65*0.1240376 *1 = -0.9488878 EUR (correct?)

Rates at swap time:
USDZAR = 9.98538 (EURUSD = 1.35027)
Swap in points. MarketInfo(“EURNOK”,MODE_SWAPLONG) = -22.69
MT4 Swap column shows: = -16.82
Swap in Deposit Currency (EUR) should be:
-22.69* TICKVALUE * Lots = -22.69*0.074865*1 = -1.6986 EUR (correct?)

For this one the SWAPTYPE is 0:US

DTRY = 2.0187 (EURUSD = 1.35027)
Swap in points. MarketInfo(“EURNOK”,MODE_SWAPLONG) = 2.85
MT4 Swap column shows: = 31.32
Swap in Deposit Currency (EUR) should be:
+2.85* TICKVALUE * Lots = 2.85*3.709336*1 = 10,57 EUR (correct?)

Does this clarify the results now?

Appears to me that still something does not match up.

Thanks

Stefano

549
2013.09.27 11:29

Select MODE_SWAPTYPE in metaeditor and press F1 for the help

0 - points

1 - base currency

2 - interest

3 - margin currency

You need to check per broker but also per currency.

If the SWAPTYPE is 1, it's telling you the swap in EUR (base currency of EURNOK) and no further calculation is required.

If the base is not EUR, e.g. GBPUSD, then the swaptype 1 means the swap value is in GBP (base of GBPUSD), so you need to divide it by the current price of EURGBP to get the value in EUR.

If the SWAPTYPE is 0, use your formula.

If the SWAPTYPE is 3, great, no need to convert.

I haven't had a chance to check SWAPTYPE 2 (interest) yet.

111
2013.09.27 13:56

I am with you, what you are saying makes much sense, but number does not seem to agree.

Would you agree in saying that the MT4 Swap column does not make any conversion, and just returns the number that MarketInfo return (according to swaptype)?
In this case, let’s review my numbers:

SWAPTYPE is 0:
USDTRY = 2.0187 (EURUSD = 1.35027)
MarketInfo(“USDTRY”,MODE_SWAPLONG) = 2.85 (in points, since swaptype =0 )
MT4 Swap column shows: = 31.32

Should also the Swap column display the result in points? Then I should see 2.5 but I see 31.32 (remember Lots=1).
Should instead the Swap column display the result in Euro? Then I should see 10,57 EUR if my calculations are correct, but I see 31.32.
+2.85* TICKVALUE * Lots = 2.85*3.709336*1 = 10,57 EUR (correct?)

So, still there is something confusing on how this value is either displayed by MT4 or calculated by me.

Thanks

549
2013.09.27 14:36

Each point difference in a currency pair is worth 1 of the quote currency. So if the USDTRY swap is 2.85 points, that means, the swap is 2.85 TRY. To get this to another currency, times or divide by the appropriate price ... luckily EUR is always first in a pair, so you can always divide.

So do 2.85 / EURTRY_price

2.86 / 2.75 = 1.04 EUR

This seems too small, so I guess 2.86 is not the number of points. For my broker the swap is long -40 and short 30 (points).

31.32 looks a more realistic number for EURTRY so do:

31.32 / 2.75 = 11.38 EUR... much better... but only if this is the short swap..?

I don't fully understand where you are getting all of the numbers from.

For me, the figure in the currency details box is always the same as MODE_SWAPLONG and MODE_SWAPSHORT.

57
2013.10.01 03:58

I was wondering if someone could answer a few questions regarding swaps :

1. I now I can use MarketInfo(“EURUSD”,MODE_SWAPLONG) in a demo platform and I get a value returned, but is this value the same as would be
used in the live platform ?

2. How often do the swap rates change ? a number of times per day ....a number of times a week ? or is there a particular day and time that they are calculated ?

Thanks in advance for any enlightenment on these questions !

3124
2013.10.01 04:41
JoBlo:

I was wondering if someone could answer a few questions regarding swaps :

1. I now I can use MarketInfo(“EURUSD”,MODE_SWAPLONG) in a demo platform and I get a value returned, but is this value the same as would be
used in the live platform ?

2. How often do the swap rates change ? a number of times per day ....a number of times a week ? or is there a particular day and time that they are calculated ?

Thanks in advance for any enlightenment on these questions !

I guess that swap rates are not calculated by the MT4 server, they are rather imported by an operator. I mentioned they change in chaotic manner and they are very specific to a broker and account type.
418
properkhunt 2013.10.02 21:07
JoBlo:

I was wondering if someone could answer a few questions regarding swaps :

1. I now I can use MarketInfo(“EURUSD”,MODE_SWAPLONG) in a demo platform and I get a value returned, but is this value the same as would be
used in the live platform ?

2. How often do the swap rates change ? a number of times per day ....a number of times a week ? or is there a particular day and time that they are calculated ?

Thanks in advance for any enlightenment on these questions !

I think this is policy for many brokers.............

Rollover rates for all positions held open after 22:00 GMT. ie account is debited or credited

Although there is no rollover on Saturdays and Sundays when the markets are closed, banks still calculate interest on any position held over the weekend. To level this time gap, a 3 day rollover strategy is applied on Wednesdays.

That is all the official cobblers many brokers spout. Remember they are all crooks. For example, one broker I have a demo account with, always alters its EURUSD short swap when many people are positioned short and especially on a Wednesday. Monday it was 0.2 now on Wednesday it is -0.2. Bastards, all of them.

400
2014.07.24 13:23

Like spronti, I cannot re-compute the swap displayed by MT4, if anybody has a solution, it may help.

My Account Currency is in "EUR".

Sample order:

Order symbol is: GBPNOK
Order type is : SELL
Order Open time : 2014.07.23 12:16:51
Order lot : 0.10
Order current swap = 0.82

Symbol Swap Type = 0 (points)

Symbol Swap Short = 22.69

Any sample formula will be appreciated. :)

12