how to convert MarketInfo(Symbol(), MODE_MARGINREQUIRED) to mt5 version - page 2

 
Use the </> insert code button please.
 
jeebs #: To convert MarketInfo(Symbol(), MODE_MARGINREQUIRED) to mt5 version is order_calc_margin

Returns the margin in the account currency for performing a specified trading operation. It's double .

order_calc_margin (
    action ,        // order type (ORDER_TYPE_BUY or ORDER_TYPE_SELL )
    symbols ,        // symbol name
    volume , // volume
    price          // opening price
)

You are mixing apples and oranges. "order_calc_margin" is for Python API for MetaTrader 5, not MQL5. It is the same functionality as "OrderCalcMargin" in MQL5.

 
jeebs #: Another way is using Class CAccountInfo in :

"CAccountInfo::MarginCheck" is just an OOP wrapper for "OrderCalcMargin".