I suppose, that myfxbook doesn't calculate pips value, but simply reading it from statements.
As Carl wrote, If you need to calculate "pips" value ask uncle Google.
MetaTrader works in points not pips.
Many people are trading forex with a 5 digit broker. Your broker quotes EURUSD to 5 digits: 1.07028
On 5 digit brokers, there are 10 points to a pip.
So, your code is correct (see parts highlighted in yellow).
8 points = 0.8 pips