Calculating difference in pips

 

Hi all I want to calculate pip difference between two  prices using mql5.


please guide.


thanks.

 
salirazataqvi:

Hi all I want to calculate pip difference between two  prices using mql5.


please guide.


thanks.

Show your code if you need coding help.
 
int pips = MathAbs(price_1-price_2)/_Point;
_Point
 
That is the difference in points not PIPs.
           What is a TICK? - MQL4 and MetaTrader 4 - MQL4 programming forum

Using Point means code breaks on 5 digit brokers, exotics (e.g. USDZAR where spread is over 500 points,) and metals. Compute what a PIP is and use it, not points.
          How to manage JPY pairs with parameters? - MQL4 and MetaTrader 4 - MQL4 programming forum
          Slippage defined in index points - Currency Pairs - Expert Advisors and Automated Trading - MQL5 programming forum