Question makes no sense. A tick is a change in price not a unit of measure. What is the difference "in ticks" between 10 am and 12 pm? Meaningless. Is is 2 hours, 120 minutes, or 7200 seconds, etc.
If you meant "tick size", now you have a unit of measure. (P1-P2)/TS.
Both for crosses of 5 and 3 decimals.
Thank you
Do you pips or points, perhaps? You can multiply the change in price by 10^(int)MarketInfo(Symbol(), MODE_DIGITS), that will give you the number of points that the price has moved. Divide that by 10, you have number of pips the price has moved. Not sure if the syntax is the exact same in MQL5, but hopefully my answer has pointed you in the right direction.
Edit, so for MQL4 you want
int points_moved = price_difference*pow(10,(int)MarketInfo(Symbol(),MODE_DIGITS));
And for MQL5 you want
int point_moved = price_difference*pow(10,SymbolInfoInteger(Symbol(),SYMBOL_DIGITS));
That is of course if you meant points, and not ticks.
pow(10,(int)MarketInfo(Symbol(),MODE_DIGITS)) pow(10,SymbolInfoInteger(Symbol(),SYMBOL_DIGITS) s a m e a s 1 / _Point
I want to find a "standarized" way to meassure changes in price, equivalent for 5 and 3 decimals Forex symbols.
Somewhere in the forum I have read that a pip is defined as 0.00010 (or for JPY 0.010)
With that in mind:
---(A)---
1,17028 -> 1,17046
---(B)---
84,040 -> 84,067
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
Haha! So it is! There's an easy way and a hard way for everything :P
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Both for crosses of 5 and 3 decimals.
Thank you