Calculating Interest

 

Is there code or command for finding how much interest is earned per day on trades and balance?


Thanks!

 
You have to code it yourself  - I would use myFxBook.
 
Would I use SYMBOL_SWAP_MODE_INTEREST_CURRENT?
 
Yellowbeard:
Would I use SYMBOL_SWAP_MODE_INTEREST_CURRENT?
I don't know SYMBOL_SWAP_MODE_INTEREST_CURRENT and I can't find it in the reference but I guess not, as this won't give you the interest per day of your system
 

https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants


At bottom of page.



SYMBOL_SWAP_MODE_INTEREST_CURRENT

Swaps are charged as the specified annual interest from the instrument price at calculation of swap (standard bank year is 360 days)

 

1) Ah, that is for mql5, this is the forum for mql4.

2) This is valid only for some symbols (e.g. bonds?)

3) I thought your question was about how much you earn from your working EA and not how much you have to pay fro holding a symbol.

 
Sorry.  I'm talking about the interest that you either earn or are charged when you close or hold a position.
 
Yellowbeard:
Sorry.  I'm talking about the interest that you either earn or are charged when you close or hold a position.
That is very symbol specific and you better ask your broker, but may be you mean swap?
 

Yes.  Some call it swap.  Some rollover.  My broker has a web page that I can go to, to figure out the interest.  It's a pain in the neck.  I was hoping that there was code where I bring these rates into my EA.  I would like to make trades based on the side of the currency pair that pays interest.


Thanks! 

 
Yellowbeard:

Yes.  Some call it swap.  Some rollover.  My broker has a web page that I can go to, to figure out the interest.  It's a pain in the neck.  I was hoping that there was code where I bring these rates into my EA.  I would like to make trades based on the side of the currency pair that pays interest.


Thanks! 

If you would have kept conttinuing reading yu would have detected: MarketInfo() where you have the opetions MODE_SWAPLONG and MODE_SWAPSHORT
Reason: