MT5 Custom Symbols - Tick Value Issue

 

Hi,

I have some code which is responsible for risking x% of capital, based upon the intended stop loss.
The code responsible for this operates fine on the live MT5 accounts, and the equivalent MT4 code functions fine on both live and the tester.
However, on MT5, using custom symbols, the value of a tick is not being calculated properly, and thus the risk calculation is being thrown off.

Here is the code relating to the calculation:

custPoint=_Point ;
if((_Digits==3) || (_Digits==5))
   custPoint*= 10 ;
pipValue = _Digits<=3? 0.01 : (_Digits>=4? 0.0001 : 0) ;
pipAmount = (((SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_VALUE)*custPoint)/SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_SIZE))*1) ;
lotRisk = 1.5 ;		// Example 1.5% Risk on Trade Loss
commPerLot = 7 ;	// Commission per Round Lot
stopLossDelta = 20 ;	// Example Stop Loss 
newLot = (AccountInfoDouble(ACCOUNT_BALANCE)*(lotRisk/100)) / (stopLossDelta*pipAmount + commPerLot);
newLot = normaliseLot(newLot);

double normaliseLot(double baseLot)
{
   double tempLot = MathFloor(baseLot/lotStep)*lotStep ;
	
   if(tempLot<minLot)
      return minLot ;
   else if(tempLot>maxLot)
      return maxLot ;
   return tempLot ;
}

The method for creating the custom symbol:
1) View/Symbols
2) Select instrument, e.g. EURUSD
3) Click "Create Custom Symbol"
4) Import Ticks

When testing, the modelling is set to "Every tick based on real ticks"

I suspected the issue may relate to not importing bar data. I tried importing M1 bar data and rerunning the test to no avail.

Regardless of what the deposit currency is, within the tester, the value of a pip is always the same. 
For example, if running EURGBP, with base currency as GBP, the pipAmount should be 10, like it is on the live accounts. However, in the tester, this is not true.

Thanks in advance for any tips!