GrumpyDuckMan:
SYMBOL_BID / SYMBOL_ASK not always 4-5 digits. I need some help please.
Second part is this code, still not at 4-5 digits. I was going to normalize as double, but I would like to ask you all about the best options availiable in MQL4
- Bid or any other price read from the broker is already normalized.
- Floating point has infinite number of decimals, it's your not understanding
floating point and that some numbers can't be represented exactly. (like 1/10.)
Double-precision floating-point format - Wikipedia, the free encyclopedia See also The == operand. - MQL4 and MetaTrader 4 - MQL4 programming forum - If you want to see the correct number of digits, convert it to a string.
question about decima of marketinfo() - MQL4 and MetaTrader 4 - MQL4 programming forum -
Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't
use it. It's use is always wrong
- SL/TP (stops) need to be normalized to tick size (not Point.) (On 5Digit Broker Stops are only allowed to be placed on full pip values. How to find out in mql? - MQL4 and MetaTrader 4 - MQL4 programming forum) and abide by the limits Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial and that requires understanding floating point equality Can price != price ? - MQL4 and MetaTrader 4 - MQL4 programming forum
- Open price for pending orders need to be adjusted. On Currencies, Point == TickSize, so you will get the same answer, but it won't work on Metals. So do it right: Trailing Bar Entry EA - MQL4 and MetaTrader 4 - MQL4 programming forum or Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 and MetaTrader 4 - MQL4 programming forum
- Lot size must also be adjusted to a multiple of LotStep and check against min and max. If that is not a power of 1/10 then NormalizeDouble is wrong. Do it right.
whroeder1:
- Bid or any other price read from the broker is already normalized.
- Floating point has infinite number of decimals, it's your not understanding
floating point and that some numbers can't be represented exactly. (like 1/10.)
Double-precision floating-point format - Wikipedia, the free encyclopedia See also The == operand. - MQL4 and MetaTrader 4 - MQL4 programming forum - If you want to see the correct number of digits, convert it to a string.
question about decima of marketinfo() - MQL4 and MetaTrader 4 - MQL4 programming forum -
Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't
use it. It's use is always wrong
- SL/TP (stops) need to be normalized to tick size (not Point.) (On 5Digit Broker Stops are only allowed to be placed on full pip values. How to find out in mql? - MQL4 and MetaTrader 4 - MQL4 programming forum) and abide by the limits Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial and that requires understanding floating point equality Can price != price ? - MQL4 and MetaTrader 4 - MQL4 programming forum
- Open price for pending orders need to be adjusted. On Currencies, Point == TickSize, so you will get the same answer, but it won't work on Metals. So do it right: Trailing Bar Entry EA - MQL4 and MetaTrader 4 - MQL4 programming forum or Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 and MetaTrader 4 - MQL4 programming forum
- Lot size must also be adjusted to a multiple of LotStep and check against min and max. If that is not a power of 1/10 then NormalizeDouble is wrong. Do it right.
Hello whoeder1,
Thank you,
After reading your reply I searched around my previous posts and found the answer.
IndicatorDigits(5)
?
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
Hello everyone,
Code below.
SYMBOL_BID / SYMBOL_ASK not always 4-5 digits. I need some help please.
Second part is this code, still not at 4-5 digits. I was going to normalize as double, but I would like to ask you all about the best options availiable in MQL4