Margin Requirements

To add comments, please log in or register
Donald Gibson
494
Donald Gibson  

My broker has changed some of its margin requirements but when I print the results I am still getting the old requirements.

When I place a trade with one of these currencies the new margin requirements are used.


Yes I have tried to get an answer from the broker but they either say it is a Metaquotes bug or no answer at all they are just guessing.

 

 copied from email..

Monday December 5th, 2016 at 5 pm EST the following margin changes will take place for both existing positions and new positions:


  • JPY pairs from 3% (maximum leverage ratio of 33.3:1) to 4% (maximum leverage ratio of 25:1)

  • NZD pairs from 2% (50:1) to 3% (33.3:1)

  • USD/MXN from 6% (16:1) to 8% (12.5:1)


At the same time we will decreasing margin requirements specifically for:


  • CHF pairs from 5% (maximum leverage ratio of 20:1) to 3% (maximum leverage ratio of 33.3:1)


double Symbol_MarginRequired_Req=MarketInfo(Symbol(),MODE_MARGINREQUIRED);
double Symbol_MarginRequired_Int=MarketInfo(Symbol(),MODE_MARGININIT);
double Symbol_MarginRequired_Sym=SymbolInfoDouble(Symbol(),SYMBOL_MARGIN_INITIAL);

Print("Symbol_MarginRequired_Req   "+DoubleToStr(Symbol_MarginRequired_Req,Digits));
Print("Symbol_MarginRequired_Int   "+DoubleToStr(Symbol_MarginRequired_Int,Digits));
Print("Symbol_MarginRequired_Sym   "+DoubleToStr(Symbol_MarginRequired_Sym,Digits));

//results

//JPY changed from 2000 to open 1 lot to 4000 

2017.01.07 05:07:11.216 Trade_Asst_Analysis USDJPY,M5: Symbol_MarginRequired_Sym 0.000

2017.01.07 05:07:11.216 Trade_Asst_Analysis USDJPY,M5: Symbol_MarginRequired_Int 0.000

2017.01.07 05:07:11.216 Trade_Asst_Analysis USDJPY,M5: Symbol_MarginRequired_Req 2000.00

 

 

am I missing something?

Has something updated again?

Anyone else noticed this? 

William Roeder
20208
William Roeder  
  1. Values of zero is obviously bogus. They come from your broker. If your broker won't fix it, then switch.
  2. I've only ever used free margin check to avoid stop out.
    • You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
    • Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the SPREAD, and DeltaPerLot is usually around $10/pip but it takes account of the exchange rates of the pair vs. your account currency.)
    • Do NOT use TickValue by itself - DeltaPerLot
    • You must normalize lots properly and check against min and max.
    • You must also check FreeMargin to avoid stop out
Donald Gibson
494
Donald Gibson  
whroeder1:
  1. Values of zero is obviously bogus. They come from your broker. If your broker won't fix it, then switch.
  2. I've only ever used free margin check to avoid stop out.
Thank you but they are no help, working on changing brokers now.
Fernando Morales
2744
Fernando Morales  

It amazes me this issue has not been resolved for many years:

  • https://www.mql5.com/en/forum/7418
  • https://www.mql5.com/en/forum/37303

One of the Admins said, long time ago (thread 7418), that SYMBOL_MARGIN_INITIALis meant for stocks symbols. However, I see my broker offers data for forex, metals, index symbols.

The following code returns 0.0

        //Object for showing MARGIN data
        LabelCreate( Name+"Test_text", "Test:", 10,100 );

        double margin=-1;
        ResetLastError();
                
        CSymbolInfo symbol;
        symbol.Name( Symbol() );
        
        margin = symbol.MarginInitial();
        
        ObjectSetString(0, Name+"Test_text", OBJPROP_TEXT, DoubleToString(margin) );

ACCOUNT_LEVERAGE always returns 200 for my European broker whereas MARGIN_INITIAL should return the correct value (see above capture from EURUSD). What alternative do we have to programmatically retrieve the correct margin requirement? I want to avoid using user input on this. The answer I got from my broker is they cannot change what ACCOUNT_LEVERAGE returns.

OrderCalcMargin() cannot be used in indicators

(bug?) SYMBOL_MARGIN_INITIAL = 0.0
(bug?) SYMBOL_MARGIN_INITIAL = 0.0
  • 2012.08.12
  • www.mql5.com
Hello MetaQuotes, I have checked SYMBOL_MARGIN_INITIAL value on several symbols and every time it returns 0.0...
JC
1646
JC  
Fernando Morales:

It amazes me this issue has not been resolved for many years [...]

I'm not sure about MT5 and its OrderCalcMargin(), but in the MT4 world there's simply no reliable cross-broker way of calculating margin usage based on data available to an EA. 

Two main reasons for that:

  • A broker may be using tiered margin requirements, rather than a flat rate such as 50:1
  • A broker may or may not calculate margin on a net position basis rather than per trade. For example, if you're long and then open a hedged short trade, your margin usage may be calculated on a net basis, and the effective margin usage of the short trade will be negative. (And closing a hedged order will then increase margin usage again.)
Alain Verleyen
38676
Alain Verleyen  
Fernando Morales:

It amazes me this issue has not been resolved for many years:

  • https://www.mql5.com/en/forum/7418
  • https://www.mql5.com/en/forum/37303

One of the Admins said, long time ago (thread 7418), that SYMBOL_MARGIN_INITIALis meant for stocks symbols. However, I see my broker offers data for forex, metals, index symbols.

The following code returns 0.0

ACCOUNT_LEVERAGE always returns 200 for my European broker whereas MARGIN_INITIAL should return the correct value (see above capture from EURUSD). What alternative do we have to programmatically retrieve the correct margin requirement? I want to avoid using user input on this. The answer I got from my broker is they cannot change what ACCOUNT_LEVERAGE returns.

OrderCalcMargin() cannot be used in indicators

This is an MT4 topic, your post is MT5. Don't mix up things like that please.

What you see on your screenshots are not the initial margin but the margin rate. It's not the same and as said by Rashid this is of no use for Forex, Metals and Index (CFD).

See here a Futures symbol specification :

From my experience, it's also a broker issue. While all is available in MT5 to get all needed information, most brokers don't set the values or do it incorrectly.

Fernando Morales
2744
Fernando Morales  
Alain Verleyen:

This is an MT4 topic, your post is MT5. Don't mix up things like that please.

What you see on your screenshots are not the initial margin but the margin rate. It's not the same and as said by Rashid this is of no use for Forex, Metals and Index (CFD).

See here a Futures symbol specification :

From my experience, it's also a broker issue. While all is available in MT5 to get all needed information, most brokers don't set the values or do it incorrectly.

Sorry for fixing platform. I arrived from the a search result from google and did not noticed it.

To add comments, please log in or register