Yeah I followed the link but didn't feel confident I understood it.
Have actually getting the same results now! Well actually, the 3rd decimal is sometimes rounded off differently but that's ok I think, it's close enough.
double pips2dbl = 0.00;
if (Digits % 2 == 1) pips2dbl = Point*10; //DE30=1/JPY=3/EURUSD=5 forum.mql4.com/43064#515262
else pips2dbl = Point;
PositionSize = RiskMoney / (RiskPips * pips2dbl * UnitCost / TickSize);
//where RiskMoney = The amount of money being risked on the trade.
//StopLoss = RiskPips i.e. The number of pips between the EntryLevel and stop-loss level.
//UnitCost = The tick value in the deposit currenty
//TickSize = The tick size in points.