Strange results of testing - page 2

 
Piotr Storozenko #2025.06.28 18:23:07.774 2024.01.08 07:55:00   Point  0.001  tick value  0.10  leverage  500 v hedg 100.00  v contract   100.00

Same print for both tests

void OnStart()
{
   double tick_value;

   if(SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE, tick_value))
   {
      Print("Tick value for ", _Symbol, " is: ", DoubleToString(tick_value, 2), " ", AccountInfoString(ACCOUNT_CURRENCY));
   }
   else
   {
      Print("Failed to retrieve tick value. Error code: ", GetLastError());
   }
}



Edit: By the way, I mentioned SYMBOL_MARGIN_RATE earlier; it was a mental lapse on my part. Of course, it doesn't exist in MQL5. I was referring to SYMBOL_MARGIN_HEDGED, SYMBOL_TRADE_CONTRACT_SIZE, etc. Sorry for the confusion.

 
Miguel Angel Vico Alba #:


Correct, your account in EURO and my in USD , so you get  1 /  kurs (eurusd)

 
Piotr Storozenko #Correct, your account in EURO and my in USD , so you get  1 /  kurs (eurusd)

Glad to hear the script worked for you.

Still, I’d like to emphasize the importance of having a clear understanding of the concepts discussed here. The account leverage shown (for example, 1:500) generally applies to Forex instruments, but it doesn’t necessarily extend to other asset types like commodities, indices, or synthetic symbols, where specific leverage rules or fixed margin models may apply.

Another key point is this:

Some brokers ‘dilute’ the contract by reducing the lot size, for example using 1 ounce instead of 100, while others do so by adding an extra digit to the price. These are different approaches that, in essence, lead to the same economic result per price movement, as long as the lot size and tick value are correctly adjusted.

Understanding both sides (the leverage conditions and the contract structure), is essential to avoid confusion when comparing results across brokers or backtests.

 
Miguel Angel Vico Alba #:

Glad to hear the script worked for you.

Still, I’d like to emphasize the importance of having a clear understanding of the concepts discussed here. The account leverage shown (for example, 1:500) generally applies to Forex instruments, but it doesn’t necessarily extend to other asset types like commodities, indices, or synthetic symbols, where specific leverage rules or fixed margin models may apply.

Another key point is this:

Some brokers ‘dilute’ the contract by reducing the lot size, for example using 1 ounce instead of 100, while others do so by adding an extra digit to the price. These are different approaches that, in essence, lead to the same economic result per price movement, as long as the lot size and tick value are correctly adjusted.

Understanding both sides (the leverage conditions and the contract structure), is essential to avoid confusion when comparing results across brokers or backtests.

As I well understood we can't be sure a 100 % what profit / lost will be when we trade on instrument like Gold  RoboForex :

I have make fast test - add calculating lot size based on  risk and  if I use number points I set position lost 10 time bigger  value money as was calculated for trade . 

Really strange :(

 
Piotr Storozenko #:

As I well understood we can't be sure a 100 % what profit / lost will be when we trade on instrument like Gold  RoboForex :

I have make fast test - add calculating lot size based on  risk and  if I use number points I set position lost 10 time bigger  value money as was calculated for trade . 

Really strange :(

Piotr, the difference you observed between RoboForex and ICMarkets is not a bug, but the result of how each broker defines the contract size per lot. Although the symbol and price may look the same, the tick value can vary significantly if, for example, one broker defines 1 lot as 1 ounce of gold and another as 100 ounces.

Therefore, it is not enough to compare prices or the overall leverage of the account. What is really reliable is to work directly with SYMBOL_TRADE_TICK_VALUE, which indicates how much money a minimum price movement (tick) represents for 1 lot, under the current symbol and account conditions.

To avoid these discrepancies between brokers, you can include in your EA a function that reads the actual tick value before each trade and adjusts the volume based on a reference value (the one you used when developing your system). This allows you to maintain proportionality between risk, profit and market movement, regardless of broker or account type.

In other words, it is possible to know with complete accuracy the expected profit or loss when trading instruments such as gold, at any broker and under any conditions, as long as you correctly program the necessary adjustments and take into account these structural differences.

 
Miguel Angel Vico Alba #:

Piotr, the difference you observed between RoboForex and ICMarkets is not a bug, but the result of how each broker defines the contract size per lot. Although the symbol and price may look the same, the tick value can vary significantly if, for example, one broker defines 1 lot as 1 ounce of gold and another as 100 ounces.

Therefore, it is not enough to compare prices or the overall leverage of the account. What is really reliable is to work directly with SYMBOL_TRADE_TICK_VALUE, which indicates how much money a minimum price movement (tick) represents for 1 lot, under the current symbol and account conditions.

To avoid these discrepancies between brokers, you can include in your EA a function that reads the actual tick value before each trade and adjusts the volume based on a reference value (the one you used when developing your system). This allows you to maintain proportionality between risk, profit and market movement, regardless of broker or account type.

In other words, it is possible to know with complete accuracy the expected profit or loss when trading instruments such as gold, at any broker and under any conditions, as long as you correctly program the necessary adjustments and take into account these structural differences.

I do not say it's a bug, I just say we can't be sure when we calculate lot size based on Risk   we get correct result.

Below simle formula for calculate lot based on risk 

enum LOT
  {
   lot1, // Lots Min
   lot2, // Constant lot
   lot3, // Risk in percent for a deal
  };

double CalculateLot()
{
  double lot=Lot;
  if(Type_Lot==lot3)
  {
    double suma=m_account.Balance()*Risk*0.01;
    
    lot=suma/(Stop_Loss*m_symbol.TickValue());
    Print("money use  "+DoubleToString(suma,2)+"  sl  "+DoubleToString(Stop_Loss,0)+"  points tick value  "+DoubleToString(m_symbol.TickValue(),2)+"  lot  "+DoubleToString(lot,2));
  }
  return(NormalizeDouble(lot,2));
}

printing

So we get 10 000 * 1 % = 100 $

tick value 0.1 

Stoploss 1000

Lot size = 1 lot 

price position  = 2043.990

SL= 2044.990

All is correct 

Now see position:

position

current price Ask ( sell opened)  2044.219

2044.219 -  2043.990 = 229 point  and trade generate lost 229 $ , when hit SL will 1000 $

so broker use 1 $ for 0.001 point

 
Looking I have something with instalation MT5 , have run same test in another instalation Roboforex on another pc and all correct.
 

Reinstal MT5 and now all correct.

Thanks for help and sorry .

 
Just to close the thread in case future readers land here:

Although Piotr solved an additional issue related to his local MT5 installation, the differences he initially observed between brokers were real and technically justified: mainly due to different contract sizes, tick values, and point definitions.

The key takeaway is that when comparing results across brokers or trying to maintain consistent backtests, relying on SYMBOL_TRADE_TICK_VALUE and adjusting the volume based on a reference value is the most reliable approach.

Thanks again to everyone involved. Hopefully this thread will be helpful to others facing similar questions.