You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
In the Help it says
ENUM_SYMBOL_CALC_MODE
Identifier
Description
The formula
SYMBOL_CALC_MODE_FOREX
Forex mode - profit and margin calculation for Forex
Margin: Lots*Contract_Size/Leverage
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_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_CFDINDEX
CFD index mode - calculation of margin and profit for CFD on indices
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 when trading with leverage
Margin: (Lots*ContractSize*MarketPrice*Percentage)/Leverage
Profit: (close_price-open_price)*Contract_Size*Lots
SYMBOL_CALC_MODE_EXCH_STOCKS
Exchange mode - calculation of margin and profit for trading securities on the exchange
Margin: Lots*ContractSize*OpenPrice
Profit: (close_price-open_price)*Contract_Size*Lots
SYMBOL_CALC_MODE_EXCH_FUTURES
Futures mode - calculation of margin and profit for trading futures contracts on the exchange
Margin: Lots*InitialMargin or Lots*MaintenanceMargin
Profit: (close_price-open_price)*Lots*TickPrice/TickSize
SYMBOL_CALC_MODE_EXCH_FUTURES_FORTS
FORTS Futures mode - calculation of margin and profit for trading futures contracts on FORTS. The margin can be decreased by the MarginDiscount value according to the following rules:
1. If the price of a long position (Buy order) is lower than the calculated price, then MarginDiscount = Lots*((PriceSettle-PriceOrder)*TickPrice/TickSize).
2. If the price of a short position (a sell order) is higher than the settlement price, then MarginDiscount = Lots*((PriceOrder-PriceSettle)*TickPrice/TickSize)
Where:
Margin: Lots*InitialMargin or Lots*MaintenanceMargin
Profit: (close_price-open_price)*Lots*TickPrice/TickSize
SYMBOL_CALC_MODE_SERV_COLLATERAL
Collateral mode - the instrument is used as a non-trading asset in the trading account. The market value of an open position is calculated on the basis of volume, current market price, contract size and liquidity ratio. The value is recorded in Assets, which are summed up with Equity. Thus, open positions in such an instrument increase the size of Free Margin and serve as additional collateral for open positions in traded instruments
Margin: no
Profit: no
Market value: Lots*ContractSize*MarketPrice*LiquityRate
It says in the Synopsis
With all due respect, I intend to take you back to your reading
P.S.
You can get it, but if we calculate by AUDCAD, then the margin will be in AUD currency, and the account is dollar. If you use AUDUSD price, you will get the required amount of margin, but it is not universal and bad, because there are accounts with prefixes and suffixes, and here starts a whole story. Also, there may simply be no open pair in the market review, and the calculation will be "buried in a cinder.
The program that works with money (the developers' claim), can not calculate the money. The old, bad and slow mt4 could work with money, but the new and fancy mt5 cannot. How so?
This is the formula from the link:
Calculate, for example, the collateral for CADJPY, we get the collateral in CAD
Where the0.7625 is CADUSD price, but the terminal doesn't even have such a pair to apply it in calculations.
Is it so difficult to transfer the"MODE_MARGINREQUIRED" calculation function to mt5 using the "copypaste" method, thus making the developers' life easier?
I would like to have a calculation independent of the program type.
With all due respect, I intend to take you back to your reading.
I admit, I wasn't paying attention. For me, the calculation of the margin was somehow always unnecessary. Especially in indicators. Where it may be necessary in indicators?
I think the solution is very simple. When I will be free, I will think it out.
You can get it, but if we calculate by AUDCAD, then the margin will be in AUD currency, and the account is a dollar account. If you substitute AUDUSD price, then we get the right amount of margin, but it is not universal and disgusting, because there are accounts with prefixes and suffixes, and there starts a whole story. Also, there may simply not be an open pair in the market review, and the calculation will be "buried in a cinder.
And what will the four return, if AUDUSD is not in the market overview?
For the specific task of margin reflection in the indicator it is possible to construct a crutch that takes into account the prefixes and suffixes (or using an auxiliary advisor). There is everything for trading.
And what will return the fourth, if AUDUSD is not in the market overview?
For the specific task of margin reflection in the indicator it is possible to construct a crutch that takes into account the prefixes and suffixes (or using an auxiliary advisor). Everything seems to be there for trading.
Four will return"MODE_MARGINREQUIRED" )
I think that calculating margin (and something else from informational functions) is a trading function and should be prohibited in indicators. I started a serious thread on this topic - its moderators have immediately cut it, as usual, anonymously. Now I don't care about it, posted a neutered indicator without margin in KB.
Is it really trading? ))) Although yes, it's not forbidden to anneal. I wonder what it trades, does it open or close, or just modify orders?
I admit, I wasn't paying attention. I always had no need to calculate my margin. Moreover in indicators. Where it may be necessary in indicators?
I think the solution is very simple. When I will be free, I will think of it.
In addition to the MA and stochastics, there are informative indicators. Not all trade with bots, for example, the information indicator to know the deposit before making a deal (observe MM), calculate the lot and see whether it fits the conditions of your TS, or do not enter into transaction and wait for another signal. And it's just a single example of use.
I think the solution is very simple. I'll figure it out when I'm free.
double GetMarginRequired( const string Symb )
{
MqlTick Tick;
return(SymbolInfoTick(Symb, Tick) ? Tick.ask * SymbolInfoDouble(Symb, SYMBOL_TRADE_TICK_VALUE) /
(SymbolInfoDouble(Symb, SYMBOL_TRADE_TICK_SIZE) * AccountInfoInteger(ACCOUNT_LEVERAGE)) : 0);
}
The solution came immediately.
double GetMarginRequired( const string Symb )
{
MqlTick Tick;
return(SymbolInfoTick(Symb, Tick) ? Tick.ask * SymbolInfoDouble(Symb, SYMBOL_TRADE_TICK_VALUE) * SymbolInfoDouble(Symb, SYMBOL_TRADE_CONTRACT_SIZE) *
SymbolInfoDouble(Symb, SYMBOL_POINT) / (SymbolInfoDouble(Symb, SYMBOL_TRADE_TICK_SIZE) * AccountInfoInteger(ACCOUNT_LEVERAGE)) : 0);
}
Thank you very much, there is still a bug with yen pairs