MT5 Backtesting : SymbolInfoDouble(name,SYMBOL_TRADE_TICK_VALUE_LOSS) returns different value than it from real trading mode

 

Hi,

I'm a newbie in MT5 EA programming, wondering if anyone can give a hand on the below question, Appreciate for your valuable  time inadvance!

Here I'm going to get the equity value change per tick price update, And my test code is below

if(log_enable)Print(name

         ,"\t",SymbolInfoDouble(name,SYMBOL_TRADE_TICK_VALUE_LOSS)

         ,"\t",SymbolInfoDouble(name,SYMBOL_TRADE_TICK_SIZE)

         ,"\t",SymbolInfoString(name,SYMBOL_CURRENCY_PROFIT)

      );


But I found the backtesting result is inconsistent with that in real-trade mode:

Here is the result value in backtesting:

2020.06.15 15:54:54.496 2020.01.01 00:55:56   USDJPY 100.0 0.001 JPY


Here is the result from the real testing mode:

2020.06.15 15:57:12.678 Trader_dfh (GBPUSD,H1) USDJPY 0.9317059536010436 0.001 JPY


It looks in the real trading mode, the SYMBOL_TRADE_TICK_VALUE_LOSS returned is calculated on USD, but in backtesting mode it is returned value is in JPY, 


Anything I miss to configure here to get the consistent result? I'd prefer all are calulated in USD.





 

I'm refering following to get the answer. 


https://www.mql5.com/en/forum/231076

https://www.mql5.com/en/forum/227407



wharf:

Hi,

I'm a newbie in MT5 EA programming, wondering if anyone can give a hand on the below question, Appreciate for your valuable  time inadvance!

Here I'm going to get the equity value change per tick price update, And my test code is below

if(log_enable)Print(name

         ,"\t",SymbolInfoDouble(name,SYMBOL_TRADE_TICK_VALUE_LOSS)

         ,"\t",SymbolInfoDouble(name,SYMBOL_TRADE_TICK_SIZE)

         ,"\t",SymbolInfoString(name,SYMBOL_CURRENCY_PROFIT)

      );


But I found the backtesting result is inconsistent with that in real-trade mode:

Here is the result value in backtesting:

2020.06.15 15:54:54.496 2020.01.01 00:55:56   USDJPY 100.0 0.001 JPY


Here is the result from the real testing mode:

2020.06.15 15:57:12.678 Trader_dfh (GBPUSD,H1) USDJPY 0.9317059536010436 0.001 JPY


It looks in the real trading mode, the SYMBOL_TRADE_TICK_VALUE_LOSS returned is calculated on USD, but in backtesting mode it is returned value is in JPY, 


Anything I miss to configure here to get the consistent result? I'd prefer all are calulated in USD.





Tick value in MQL5
Tick value in MQL5
  • 2018.03.07
  • www.mql5.com
Hello, can anyone explain how to get a tick value MQL 5? I use SYMBOL_TRADE_TICK_VALUE but it return 56.88 for EURUSD, this is wrong for sure...