Download MetaTrader 5

Calculating Interest

To add comments, please log in or register
Paul
526
Paul  

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


Thanks!

Carl Schreiber
6690
Carl Schreiber  
You have to code it yourself  - I would use myFxBook.
Paul
526
Paul  
Would I use SYMBOL_SWAP_MODE_INTEREST_CURRENT?
Carl Schreiber
6690
Carl Schreiber  
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
Paul
526
Paul  

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)

Carl Schreiber
6690
Carl Schreiber  

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.

Paul
526
Paul  
Sorry.  I'm talking about the interest that you either earn or are charged when you close or hold a position.
Carl Schreiber
6690
Carl Schreiber  
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?
Paul
526
Paul  

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! 

Carl Schreiber
6690
Carl Schreiber  
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
To add comments, please log in or register