Newbie need help with basic coding

 
I want to find the pip difference between open price and close price of last  candle. How can I do that in mql5? Thank you in advance 💓
 
enamuhoss: I want to find the pip difference between open price and close price of last  candle. How can I do that in mql5?
  1. Perhaps you should read the manual. Timeseries and Indicators Access
       How To Ask Questions The Smart Way. (2004)
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

  2. PIP, Point, or Tick are all different in general.
              What is a TICK? - MQL4 programming forum #35 (2014)

    Unless you manually adjust your SL/TP for each separate symbol, using Point means code breaks on 4 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 programming forum (2017)
              Slippage defined in index points - Expert Advisors and Automated Trading - MQL5 programming forum (2018)

  3. Was this so hard you couldn't do it?

    double openPrice     = iOpen( _Symbol, _Period, 0),
           closePrice    = iClose(_Symbol, _Period, 1),
           difference    = openPrice - closePrice,
           pip           = _digits % 2 ? _Point : _Point * 10,
           pipDifference = difference / pip;
Reason: