Hello Folks.
Im trying to put some code together which will calculate me the spread in Pibs plus one fraction (e.g. 1.5 Pibs)
What works so far is getting a result like:
0.00015 if I just do the following on a five digit broker with e.g. EURUSD:
Now to see the Pibs as mentioned above (1.5) I could make a calculation like
But this will cause a mess if used with a four digit broker or with USDJPY.
So I guess what I do need is something like en exponential calculation, which I don't know how to do it in mql4.
Something like this:
SpreadInPibs = SpreadInBrokerDigits * 10 Exponential Digits - 1
The digits above refer to the Digits which MT4 would give me using the function/code "digits"
Any input from anybody - maybe even a total different (better/cleaner) way to do this??
Thanks.
MikeFT
Im trying to put some code together which will calculate me the spread in Pibs plus one fraction (e.g. 1.5 Pibs)
What works so far is getting a result like:
0.00015 if I just do the following on a five digit broker with e.g. EURUSD:
Inserted Code
Spread = Ask-Bid; SpreadInBrokerDigits=DoubleToStr(Spread, Digits);
Inserted Code
double SpreadInPibs; SpreadInPibs = SpreadInBrokerDigits * 10000
So I guess what I do need is something like en exponential calculation, which I don't know how to do it in mql4.
Something like this:
SpreadInPibs = SpreadInBrokerDigits * 10 Exponential Digits - 1
The digits above refer to the Digits which MT4 would give me using the function/code "digits"
Any input from anybody - maybe even a total different (better/cleaner) way to do this??
Thanks.
MikeFT