XAGUSD costs

 

Hello,

i tried to calculate costs in account currency for a XAGUSD move.

My formula for this 

points  * volume * point_value

 points is the number of basis points of this price move. The move was from 22.68 to 20.06.

As a point is 0.01, resulting points = -262.

The volume was 0.03. Now, the important thing here is point_value:

_SYMBOL_TRADE_TICK_VALUE = SymbolInfoDouble("XAGUSD",SYMBOL_TRADE_TICK_VALUE);
_SYMBOL_TRADE_TICK_SIZE = SymbolInfoDouble("XAGUSD",SYMBOL_TRADE_TICK_SIZE);
point_value= _SYMBOL_TRADE_TICK_VALUE / (_SYMBOL_TRADE_TICK_SIZE/ 0.01);     

A dump of all XAGUSD properties shows this: 


XAGUSD point=0.010000 digits=2 point-value=0.010000 min-vol=0.010 trade-tick-val=0.010000 trade-tick-size=0.010000 bid=24.05 ask=24.09 last=0.00

According to calculation above, the long costs for this move (from 22.68 to 20.06) = -262 * 0.03 * 0.01 ~ - 0.08

But the real balance drawdown (balance after closed - balance before) was about  -380.

 

Can anyone explain this. What do i wrong ? I use the formula for forex as well and in this cases it seems to work correctly -> Calculated costs pretty close to balance difference.

Thank you for help 

 


Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Account Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Account Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Account Properties - Documentation on MQL5
 
chinaski:

Hello,

i tried to calculate costs in account currency for a XAGUSD move.

My formula for this 

 points is the number of basis points of this price move. The move was from 22.68 to 20.06.

As a point is 0.01, resulting points = -262.

The volume was 0.03. Now, the important thing here is point_value:

A dump of all XAGUSD properties shows this: 


According to calculation above, the long costs for this move (from 22.68 to 20.06) = -262 * 0.03 * 0.01 ~ - 0.08

But the real balance drawdown (balance after closed - balance before) was about  -380.

 

Can anyone explain this. What do i wrong ? I use the formula for forex as well and in this cases it seems to work correctly -> Calculated costs pretty close to balance difference.

Thank you for help 

The problem is your point value, your calculation is wrong. You have to take into account what is a lot. The formula to use is :

point value = contract size (1 lot) * point size.

  • For XAGUSD, usually contract size is 5000 (troy ounce), point size is here 0.01, that gives you a point value of 5000 * 0.01 = 50 USD.
  • For EURUSD, 100 000 * 0.00001 = 1 USD (5 digits point).
  • For GBPJPY, 100 000 * 0.001 = 100 JPY (3 digits point), if your account is in USD, you have to convert JPY to USD, so : 100 / 98.55 (quote when I write) = 1.015 USD 

In your example the result is : 262 * 0.03 * 50 = 393 USD

EDIT : The value returned for SYMBOL_TRADE_TICK_VALUE seems incorrect in your case.

 
angevoyageur:

The problem is your point value, your calculation is wrong. You have to take into account what is a lot. The formula to use is :

point value = contract size (1 lot) * point size.

  • For XAGUSD, usually contract size is 5000 (troy ounce), point size is here 0.01, that gives you a point value of 5000 * 0.01 = 50 USD.
  • For EURUSD, 100 000 * 0.00001 = 1 USD (5 digits point).
  • For GBPJPY, 100 000 * 0.001 = 100 JPY (3 digits point), if your account is in USD, you have to convert JPY to USD, so : 100 / 98.55 (quote when I write) = 1.015 USD 

In your example the result is : 262 * 0.03 * 50 = 393 USD

EDIT : The value returned for SYMBOL_TRADE_TICK_VALUE seems incorrect in your case.

So 0.01 returned by SymbolInfoDouble("XAGUSD",SYMBOL_TRADE_TICK_VALUE) is wrong, is this correct ?

 
chinaski:

So 0.01 returned by SymbolInfoDouble("XAGUSD",SYMBOL_TRADE_TICK_VALUE) is wrong, is this correct ?

Yes? here is what I get for an account in EURUSD :

2013.08.26 13:17:14    testChartEvent (EURUSD,H1)    SYMBOL_TRADE_TICK_VALUE for XAGUSD(SILVER) = 3.738122116973317
2013.08.26 13:17:14    testChartEvent (EURUSD,H1)    SYMBOL_TRADE_TICK_SIZE for XAGUSD(SILVER) = 0.001

 
angevoyageur:

Yes? here is what I get for an account in EURUSD :

2013.08.26 13:17:14    testChartEvent (EURUSD,H1)    SYMBOL_TRADE_TICK_VALUE for XAGUSD(SILVER) = 3.738122116973317
2013.08.26 13:17:14    testChartEvent (EURUSD,H1)    SYMBOL_TRADE_TICK_SIZE for XAGUSD(SILVER) = 0.001

Hello,

not so with my MT5 (metaquotes demo). 

It returns 0.01

double _SYMBOL_TRADE_TICK_VALUE=SymbolInfoDouble("XAGUSD",SYMBOL_TRADE_TICK_VALUE);
 
chinaski:

Hello,

not so with my MT5 (metaquotes demo). 

It returns 0.01

Your are right, you can report this as a bug to ServiceDesk.
 
angevoyageur:
Your are right, you can report this as a bug to ServiceDesk.
Thank you for help, angevoyageur