Doesn't SYMBOL_TRADE_TICK_VALUE refer to the profit corresponding to a position fluctuation?

 

According the MQL5 Reference

  • SYMBOL_TRADE_TICK_VALUE

    Value of SYMBOL_TRADE_TICK_VALUE_PROFIT

  • SYMBOL_TRADE_TICK_VALUE – one-tick price change value for a profitable position

 Isn't SYMBOL_TRADE_TICK_VALUE the value corresponding to every 1 point fluctuation?

======

To calculate the profit in points on a position, my method is:

 int Ticket_ProfitPoint( ulong ticket)
 {
   if (!PositionInfo.SelectByTicket(ticket))
     return ( 0 );
   double profit = PositionInfo.Profit();
   double volume = PositionInfo.Volume();
   double tickvalue = SymbolInfoDouble (PositionInfo. Symbol (), SYMBOL_TRADE_TICK_VALUE );
 
   return (( int )(profit / volume / tickvalue));
 });

The profit in points calculated by foreign exchange varieties is correct, but for some CFDs, such as XAUUSD, the result is wrong.

For example, XAUUSD, profit 0.02, position 0.01, tick_value=0.1. Points are calculated as = 20, but actual points = 2.

I want to know what is wrong? Is it wrong to use SYMBOL_TRADE_TICK_VALUE in my formula? Doesn't SYMBOL_TRADE_TICK_VALUE refer to the profit corresponding to a position fluctuation?

======

I know that the profit in points can be calculated from the price diff, but I would like to know where is my formula wrong?

If my formula is wrong, then assuming you know the profit in pips and the size of the position, it is impossible to get the profit.

 
Аврора:

Isn't SYMBOL_TRADE_TICK_VALUE the value corresponding to every 1 point fluctuation?

... to every SYMBOL_TRADE_TICK_SIZE  fluctuation.

 
fxsaber #:

... to every SYMBOL_TRADE_TICK_SIZE  fluctuation.

yes, i know it.

but to XAUUSD,  profit 0.22,  position 0.01,  SYMBOL_TRADE_TICK_VALUE=0.1,  SYMBOL_TRADE_TICK_SIZE = 0.01,  digits =2.

actual  profitpoints = 22.

how to calculate it?  

 
Аврора #:

how to calculate it?

ENUM_SYMBOL_CALC_MODE

 

Thanks. 

SYMBOL_CALC_MODE_FUTURES

Futures mode - calculation of margin and profit for futures

Margin: Lots * InitialMargin * Margin_Rate

 

Profit:  (close_price - open_price) * TickPrice / TickSize*Lots


On Futures,  TickPrice is SYMBOL_TRADE_TICK_VALUE ?

 
Isn't that margin calculation??

Every symbol has margin / base currency and profit currency.

Profit is calculated as follows:

1.0 / quote = fraction per tick.

This now needs to be transferred to account currency.

Depending on which side your account currency is from the symbol between profit currency and account currency.

Example:
Account currency EUR
Chart Symbol: AUDCAD

Quote of AUDCAD: 1.62345
Quote of EURAUD: 1.24567

Fraction (AUDCAD): 1.0/1.62345
Euro value: fraction * (1.0/1.24567)

To account for different symbols the calculation is as follows.

(Contract size * Point * volume) = 1.0 (in this case the volume is 1.0)
 
Аврора #:

On Futures,  TickPrice is SYMBOL_TRADE_TICK_VALUE ?

Ask on the Russian-language forum, there is more likely to get an answer.

 

It has been discussed numerous time on this forum, with code provided. Please do some researches before posting.

Аврора #:

yes, i know it.

but to XAUUSD,  profit 0.22,  position 0.01,  SYMBOL_TRADE_TICK_VALUE=0.1,  SYMBOL_TRADE_TICK_SIZE = 0.01,  digits =2.

actual  profitpoints = 22.

how to calculate it?  

The tick value is incorrect. It happens regularly for non Forex symbols on some brokers.
 
Dominik Christian Egert #:
Isn't that margin calculation??

Every symbol has margin / base currency and profit currency.

Profit is calculated as follows:

1.0 / quote = fraction per tick.

This now needs to be transferred to account currency.

Depending on which side your account currency is from the symbol between profit currency and account currency.

Example:
Account currency EUR
Chart Symbol: AUDCAD

Quote of AUDCAD: 1.62345
Quote of EURAUD: 1.24567

Fraction (AUDCAD): 1.0/1.62345
Euro value: fraction * (1.0/1.24567)

To account for different symbols the calculation is as follows.

(Contract size * Point * volume) = 1.0 (in this case the volume is 1.0)

This is the way to go when you can't rely on provided symbol's setting (See XAUUSD example above), however your formula is incomplete.

See https://www.mql5.com/en/forum/373815

Calculating Pip Size and and Questions about Tick/Lot Size Values
Calculating Pip Size and and Questions about Tick/Lot Size Values
  • www.mql5.com
Hi All, I am currently new to MT4 and I want to compute for the pips with minimal hard coding...
 
Thank you.

So I am missing spread and direction and loss or profit situations, right?


 
Alain Verleyen #:

It has been discussed numerous time on this forum, with code provided. Please do some researches before posting.

The tick value is incorrect. It happens regularly for non Forex symbols on some brokers.

I would like to ask, is there any way to obtain the tickevalue when analyzing historical position? Obviously, many symbols of tick value are dynamic.

I haven't found the corresponding post. Can you send it to me?

Reason: