In the MQL5 help file we see the following table documenting how margin is calculated for each type of instrument:
ENUM_SYMBOL_CALC_MODE
Identifier | Description | Formula |
SYMBOL_CALC_MODE_FOREX | Forex mode - calculation of profit and margin for Forex | Margin: Lots*Contract_Size/Leverage Profit: (close_price-open_price)*Contract_Size*Lots |
SYMBOL_CALC_MODE_CFD | CFD mode - calculation of margin and profit for CFD | Margin: Lots *ContractSize*MarketPrice*Percentage/100 Profit: (close_price-open_price)*Contract_Size*Lots |
SYMBOL_CALC_MODE_FUTURES | Futures mode - calculation of margin and profit for futures | Margin: Lots *InitialMargin*Percentage/100 Profit: (close_price-open_price)*TickPrice/TickSize*Lots |
SYMBOL_CALC_MODE_CFDINDEX | CFD index mode - calculation of margin and profit for CFD by indexes | Margin: (Lots*ContractSize*MarketPrice)*TickPrice/TickSize Profit: (close_price-open_price)*Contract_Size*Lots |
SYMBOL_CALC_MODE_CFDLEVERAGE | CFD Leverage mode - calculation of margin and profit for CFD at leverage trading | Margin: (Lots*ContractSize*MarketPrice*Percentage)/Leverage Profit: (close_price-open_price)*Contract_Size*Lots |
I have searched high and low, and cannot find a way to determine what the instrument's Percentage is. What call is made, with what enum to get this value?
Thanks!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
In the MQL5 help file we see the following table documenting how margin is calculated for each type of instrument:
ENUM_SYMBOL_CALC_MODE
Identifier
Description
Formula
SYMBOL_CALC_MODE_FOREX
Forex mode - calculation of profit and margin for Forex
Margin: Lots*Contract_Size/Leverage
Profit: (close_price-open_price)*Contract_Size*Lots
SYMBOL_CALC_MODE_CFD
CFD mode - calculation of margin and profit for CFD
Margin: Lots *ContractSize*MarketPrice*Percentage/100
Profit: (close_price-open_price)*Contract_Size*Lots
SYMBOL_CALC_MODE_FUTURES
Futures mode - calculation of margin and profit for futures
Margin: Lots *InitialMargin*Percentage/100
Profit: (close_price-open_price)*TickPrice/TickSize*Lots
SYMBOL_CALC_MODE_CFDINDEX
CFD index mode - calculation of margin and profit for CFD by indexes
Margin: (Lots*ContractSize*MarketPrice)*TickPrice/TickSize
Profit: (close_price-open_price)*Contract_Size*Lots
SYMBOL_CALC_MODE_CFDLEVERAGE
CFD Leverage mode - calculation of margin and profit for CFD at leverage trading
Margin: (Lots*ContractSize*MarketPrice*Percentage)/Leverage
Profit: (close_price-open_price)*Contract_Size*Lots
I have searched high and low, and cannot find a way to determine what the instrument's Percentage is. What call is made, with what enum to get this value?
Thanks!