MARGIN CALCULATIONS: APPLICABLE TO FOREX, CFD, ENERGY, INDEX, METALS
BASE CURRENCY MARGIN
1. Sometimes, Margin Leverages are quoted as ratios
2. Sometimes, Margin Leverages are quotes as percentages
3. Margins are quoted in the
BASE Currency. (EUR/USD - BASE/QUOTE) Easy remembrance: Alphabetically, B before Q.
4.
Note: When Base currency margin is applied in live trading it is converted to
DEPOSIT Currency.
5.
Note: Base Currency calculation is a prerequisite to Deposit Currency calculation.
SO - How to convert from ratio to percentage and percentage to ratio.
- 50:1 >> to percentage: (1/50)*100 = 2.00%.
- 2 % >> to ratio: 100/2 = 50 = 50:1
- 300:1 >> (1/300)*100 = 0.333333R(3 recurring) = 0.33 %(to two decimal places)
- 0.33% >> 100/0.33 = 100/0.33333 (extend the recurring 3 to - at minimum - 5 places*) = 300.003 = (disregard the .003 decimal ) = 30:1
* If you don't extent the recurring decimal - and do this - 100/0.33 - this is what you get - 303.030303. ❌
SO - how to calculate Base Cur Marg (Base Currency Margin)
Currency Units - sometimes referred to Contract Size
0.01 lot = 1,000 currency units.
0.10 lot = 10,000 currency units
1.00 lot = 100,000 currency units
- 1/500*100,000 = 200 (Base Currency Margin)
- 1/400*100,000 = 250
- 1/300*100,000 = 333.33333R = 333.33
CONVERSION FROM BASE CURRENCY MARGIN TO DEPOSIT CURRENCY MARGIN (Live or demo applied margin is always in DEPOSIT CURRENCY)
Assuming a deposit currency - USD.
In the below Margin examples the the column 500:1 is considered.
1. Line USDJPY: the deposit currency is the same as base currency so the exchange rate is 1.00000 (or, parity) and therefore corresponds to the the line Base Cur Marg in the top image.
Required Margin for 1 Lot = Base Cur Marg*Exchange Rate*Lot = 200*1*1 = USD 200. (for 0.01 Lot = 200*1*0.01 = USD 2.00)
2. Line EURUSD: the base currency is EUR and the deposit currency is USD - so the current exchange rate is applied.
Required Margin = Base Cur Marg* Exchange Rate*Lots = 200*1.039008*1 = USD 207.89 (for 0.01 Lot = 200.80*1.03900*0.01 = USD 2.078 = USD 2.08
3. What would be the required margin against EURUSD if the deposit currency was EUR. As the Base Cur and the deposit currency is the same = 200*1*1(lot) = EUR 200.
4. Line GBPUSD: By now things should be clear - 200*1.24250*1 = USD 248.50
5. If the deposit currency was EUR, then re GBPUSD the relevant exchange GBPEUR rate should be applied and the margin will be in EUR, the deposit currency.
GOOGLE SHEETS: RELEVANT FORMULAS
Leverage %: =(1/500)*100, =(1/400)*100, etc
Base Cur Marg: =(1/500)*100,000, =(1/400)*100,000, =(1/300)*100,000
Line USDJPY: =(1/500)*100,000, =(1/400)*100,000, =(1/300)*100,000
Note: On my Google Sheet 200, 250, 333,333 on line USDJPY are cells D30, E30, F30 and and Exchange 1.03900 is cell M31 and exchange 1.24250 is M32.
Line EURUSD: =D$30*$M31, =E$30*$M31, =F30*$M31 (=D30*$M31*1 is not necessary because the calculation is against one lot) (copy first cell and paste into subsequent cells - CHECK THAT VALUES ARE CORRECT)
Line GBPUSD: = D$30*$M32, =E$30*$M32, =F&30*$M32 (copy first cell and paste into subsequent cells - CHECK THAT VALUES ARE CORRECT)
Cell M31: =googlefinance("CURRENCY: EURUSD") or =googlefinance("EURUSD")
Cell M32: =googlefinance("CURRENCY: GBPUSD") or =googlefinance("GBPUSD")
-------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Coders coding margin for MT4 beware:
- Because retail forex is not traded from a centralised exchange brokers are at liberty to define their own specification - tick value, leverage, thus margins etc.
- Many brokers do not translate Base Currency specifics into Deposit Currency specifics.
- If such be the case, while your code is 100% correct - it can only read broker defined specifications as defined by the broker - it will not mirror values in the terminal.
- The issue is beyond the scope of this brief : Interested - see: https://www.forexfactory.com/thread/post/13046957#post13046957