Caculator Point (not pip, 1 pip = 10 point) between 2 prices

 

Hello, i want to caculator point between 2 prices.

Example: i want to caculator point between 2 price: 0.66980 and 0.67100 in AUDUSD, or 27114.32 and 27042.34 in BTCUSD.

Can you give me the code to solve this problem? Thank you. (Function is better).

 
// Just an example — not compiled, nor tested, just typed out.
// This assumes that the prices are from the current chart's symbol

int nPriceRangePoints = (int) round( ( dbPrice1 - dbPrice2 ) / _Point );
 

Also, please read up on the following ...

_Point

Size of the current symbol point in the quote currency

Point

Returns the point size of the current symbol in the quote currency

SymbolInfoDouble

Returns the double value of the symbol for the corresponding property

SYMBOL_POINT

Symbol point value

double

 
Fernando Carreiro #:
Thank you very much!
Reason: