==================
May refer to
https://www.luckscout.com/leverage-margin-balance-equity-free-margin-and-margin-level-in-forex-trading/
Initially I had $200,000.
In trade tab,
I opened buy 1 lot (100 ounces) of GOLD at $1,223.26 (ask price) and I should need to pay $122,326 for GOLD with $77,674 USD left.
At this moment my total balance of all assets is still $200,000 whatever what I bought.
Few days later, bid ask prices are $1,211.94 and $1,222.44.
If I had to sell I would need to sell at bid price, and so my GOLD asset has value of $1,221.94.
Trade tab shows my profit -$132.00 which is ($1,221.94 - $1223.26) x 100 ounces.
Also I need to pay the swap of -$55.31 and so my total profit is -$187.31.
MT4 calculates the equity = $200,000 - $187.31 = $199,812.69
As the marginis fixed at $1000, the Free margin is $198,812.69 / $1,000 * 100% = 19881.27%
MT4 pumping mode publishes the margin level with balance $200,000, equity $199,812, volume 100, margin 1000.
MT4 derives margin free and margin level from equity and margin.
Golden Formula
==============
For each trade, calculate profit by difference of open price and market price, add
-----
In MT4 the profit is a derived value not a stored value.
Profit is derived from Margin where Margin contains equity and balance.
In MT4 ReportAPI ReportSegregated.cpp
Pnl = MarginLevel.equity - MarginLevel.balance
Equity is calculated by UserRecord.balance + UserRecord.Credit + PnL.PnL
沒有留言:
張貼留言