At the moment, it is the weekend, I don't have any positions open and cannot trade on my demo account, so cannot thoroughly evaluate any theories. Does anybody know the exact method in which MetaTrader converts the profit into the account currency for an instrument where the account, base and profit currency are different.
For example, lets say I have a GBP account and have traded EURUSD. The base and profit currencies are EUR and USD. How does it convert the USD profit into GBP Profit. Does it use the GBPUSD mid ? Does it use the GBPUSD bid or ask depending upon if the account is in profit or in loss ? Does it use another method ?
Thanks for the help.
Mark
To covert from USD to GBP, you are basically sell USD to buy GBP. In other words, you are buying GBPUSD. Since you always sell at bid and buy at ask, therefore you use ask price in your case.
However, there is not much difference for small amount of money if you use either bid or ask for buy or sell. Usually I just use bid price to simplify my calculation.
To covert from USD to GBP, you are basically sell USD to buy GBP. In other words, you are buying GBPUSD. Since you always sell at bid and buy at ask, therefore you use ask price in your case.
However, there is not much difference for small amount of money if you use either bid or ask for buy or sell. Usually I just use bid price to simplify my calculation.
- 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
Thanks for the response
Actually this is a debatable question with very long story. MQ states, that you're right - they use ask or bid depending from positive or negative result. This is why they provide separate values - SYMBOL_TRADE_TICK_VALUE_PROFIT and SYMBOL_TRADE_TICK_VALUE_LOSS. Some other people say that ask or bid should have nothing to do with profit or loss in the trade, but solely depend from direction of the trade.
P.S. Here is a thead in Russian forum.
Actually this is a debatable question with very long story. MQ states, that you're right - they use ask or bid depending from positive or negative result. This is why they provide separate values - SYMBOL_TRADE_TICK_VALUE_PROFIT and SYMBOL_TRADE_TICK_VALUE_LOSS. Some other people say that ask or bid should have nothing to do with profit or loss in the trade, but solely depend from direction of the trade.
P.S. Here is a thead in Russian forum.
Why do you care how, just do it.
- 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
Thanks for the response.
Firstly, i'm not looking at placing stop losses. I am trying to evaluate what kind of Gap risk a trade has, so I am looking at large movements, not small.
In your second calculation you are using DeltaPerLot, which I assume from your link, is referring to MarketInfo(.., MODE_TICKVALUE) / MarketInfo(...,MODE_TICKSIZE).
When you are dealing with profit currencies that are the same as the base currency (e.g. GBPUSD in a USD account), then this calculation is very easy and static. However I don't know if you have noticed this, but when you are dealing with situations where the currencies in the book are very different (e.g. EURUSD in a GBP account), then MODE_TICKVALUE changes. This then raises the question - how is MODE_TICKVALUE calculated and if you answer that question, you will probably answer my original question at the same time.
In all likelihood is is probably a simple first order derivative calculation, converted into another currency using an fx rate. You could ask yourself i) What is the size of the bump used when calculating MODE_TICKVALUE (TICKSIZE would be a sensible first guess) and what FX rate is used to convert MODE_TICKVALUE into the account currency. The second answer is probably the same as my original question.
- 2011.08.20
- www.mql5.com
Why do you care how, just do it.
- 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
I have been trying to think of another way to express this. Lets say you have a stock worth USD 100 and the ticksize is 1, then the TickValue is probably going to be 1. However what happens when I convert that into GBP.
When I look at an fx trade for example, I know that the profit is going to be NoLots*LotSize*(Close-Open), but what I don't know is how that profit is converted into the account currency. The reason that I am asking is that I got different results when comparing risk using the TICKVALUE/TICKSIZE calculation with some online risk calculators when I was looking at this on Friday and I wanted to understand the exact reasons for these differences. I found the following section highlighting how the P&L is calculated:
https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants#enum_symbol_calc_mode
I can use this to double check my P&L calculations and compare them to websites, except for the fact that I don't know what rate is used.
To me, it makes sense to compare my risk calculations to some external calculations and make sure that I can explain those differences properly.
- www.mql5.com
There is not 1 solid argument in this discussion from the ones saying the pip value depends of the direction.
I'm not sure. One of alternative reasonings is the following.
Consider we want to buy EURGBP at moment X and then sell it at moment Y on USD account. Then
return (profit or loss) ~ eurgbp_bid_y * gbpusd_bid_y - eurgbp_ask_x * gbpusd_ask_x
or without crosses
return (profit or loss) ~ (eurusd_bid_y - eurusd_ask_x) + (gbpusd_ask_y - gbpusd_bid_x)
No matter if I win or lose, I must use ask to buy GBP for USD first then EUR for GBP at the entry and then use bid to sell EUR for GBP then sell GBP for USD at the exit. Profit or loss is just a difference between 2 operations in predefined directions. The directions will not change depending from profit or loss.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
At the moment, it is the weekend, I don't have any positions open and cannot trade on my demo account, so cannot thoroughly evaluate any theories. Does anybody know the exact method in which MetaTrader converts the profit into the account currency for an instrument where the account, base and profit currency are different.
For example, lets say I have a GBP account and have traded EURUSD. The base and profit currencies are EUR and USD. How does it convert the USD profit into GBP Profit. Does it use the GBPUSD mid ? Does it use the GBPUSD bid or ask depending upon if the account is in profit or in loss ? Does it use another method ?
Thanks for the help.
Mark