price point

 

Wich is the best and fastest way to get a result in Points? maybe 30, 50, 70 instead of 0.0000

actually i'm doing like this


(price_TP - price_buy)*100000;

it works but maybe is not the best way...

i try doing *Point but it doesnt look working

 
(price_TP - price_buy)/_Point;
 
(price_TP - price_buy)*100000;

Don't hard code numbers; fails on any JPY pair. Divide by Point to get it in points. 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 and MetaTrader 4 - MQL4 programming forum

 
/_Point

it works...


and if i wont from Points to go back to real price, is it the same like this 

*_Point

or it changes?

 
florenceale:

Wich is the best and fastest way to get a result in Points? maybe 30, 50, 70 instead of 0.0000


Take a look at MarketInfo()

https://docs.mql4.com/marketinformation/marketinfo

And also..

https://docs.mql4.com/constants/environment_state/marketinfoconstants


It's extremely useful if you are doing multiple currency analysis.

double symbolPoint = MarketInfo(Symbol(),MODE_POINT); //get the point value of the current chart symbol

 

- Jack

MarketInfo - Market Info - MQL4 Reference
MarketInfo - Market Info - MQL4 Reference
  • docs.mql4.com
Returns various data about securities listed in the "Market Watch" window. A part of information about the current security is stored in predefined variables.