Try this:
if( StringFind(Symbol(), "JPY", 0) >= 0) { myPoint = 0.01; pointsInPip = myPoint/Point; } else { myPoint = 0.0001; pointsInPip = myPoint/Point; }
Thanks phy, that is ideal.
Presumably then pairs that use JPY as either the base or quote currency always have a pip value of 0.01 and all other pairs always have a pip value of 0.0001.
Presumably then pairs that use JPY as either the base or quote currency always have a pip value of 0.01 and all other pairs always have a pip value of 0.0001.
JPY only appears on the right side, and is the only (that I know of) pair that quotes in 2 digits (normally)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
However, one of my brokers (Tradeview) quote to 10ths of a pip. For them GBP/USD is quoted to 5 decimal places, 0.00001, but a pip is still 0.0001, so a pip is actually 10 points.
Since I am trying to write portable MQL4 code how can one determine programatically how many points constitute a pip?