How to Calculate Swap Per Micro Lot of One Night in MT4?

 

Well, my code is :

MarketInfo(Pair,MODE_TICKVALUE) * 0.01 * 10 * MarketInfo(Pair,19)


The problem is: the code gives me double the actual value! So, i have to divide it by 2. Which i don't understand why!

eg: if the actual swap is 10, the my code gives me 20!

Can some one give me the proper formula to calculate swap in the deposited currency?

btw, i'd also like to know the value of one lot of any pair in terms of deposited currency :)


thanks :)

 
nokimchen:

Well, my code is :

MarketInfo(Pair,MODE_TICKVALUE) * 0.01 * 10 * MarketInfo(Pair,19)

What does 19 mean ?  wouldn't your code be more readable if you used the Constant name instead of its number ?  also anyone wishing to help wouldn't need to look it up  . . . 
 
19 means the number of points that i gain or loss in swap
 
nokimchen:
19 means the number of points that i gain or loss in swap

Really ?  I thought it meant   MODE_SWAPSHORT  

So why not write your code like this . . .

MarketInfo(Pair, MODE_TICKVALUE) * 0.01 * 10 * MarketInfo(Pair, MODE_SWAPSHORT)
 
RaptorUK:

Really ?  I thought it meant   MODE_SWAPSHORT  

So why not write your code like this . . .


LOL, I thought he knew what he was talking about :D.

Click what RaptorUK wrote there, that's a link - check also for MarketInfos's MODE_SWAPLONG, and MODE_SWAPTYPE. 

Reason: