- How to change the indicator to EA
- EA with the VPS,,Why will display a "trade operations not allowed by Settings "
- Rsi Ea
- Your post is almost unintelligible. If you are using mechanical translation, you must use simple
language structure.
- There is no picture in your post
- "Automatically under a single first" is non-sense.
- You haven't stated a problem, so we can't possibly know where.
- You haven't stated a problem, so we can't possibly know how.
double curbid=NormalizeDouble(Bid,5);
Prices are already normalzed. Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it. It's use is usually wrong, as it is in this case.- Print out your values to the precision you want with DoubleToString - Conversion Functions - MQL4 Reference.
- 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.
double TD=DoubleToStr(curbid/Point-prevbid/Point); if((TD)>=50*Point )
- Assuming cur/previous is 1.12346/1.12345 you compute 112346.0-112345.0 which is 1.0
- You then make it a string "1."
- You then make it a double 1.0 and assign it.
- You then compare 1.0 to 0.00050 which is always true for any uptick.
bool a=OrderSend(Symbol(),OP_BUY,0.01,Ask,10,Ask-100*Point,Ask+500*Point,"BUY" ,12345,Red);
-
You buy at the Ask and sell at the Bid.
- Your buy order's TP/SL are triggered when the Bid reaches it. Not the Ask.
-
Your sell order's TP/SL will be triggered when the Ask reaches it. To trigger at
a specific Bid price, add the average spread.
MODE_SPREAD (Paul) - MQL4 and MetaTrader 4 - MQL4 programming forum - Page 3 - The charts show Bid prices only. Turn on the Ask line to see how big the spread is (Tools -> Options {control-O} -> charts -> Show ask line.)
-
Check your return codes for errors, and report them including GLE/LE.
Don't look at it unless you have an error.
Don't just silence the compiler, it is trying to help you.
What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
Only those functions that return a value (e.g. iClose, MarketInfo, etc.) must you call ResetLastError before in order to check after.
-
You buy at the Ask and sell at the Bid.
Thank you very much! I need to spend some time to understand your message!
- ..
Prices are already normalzed. Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it. It's use is usually wrong, as it is in this case.
...
Forum on trading, automated trading systems and testing trading strategies
General rules and best practices of the Forum.
About NormalizeDouble().
Please do not mislead people with wrong or partially true/false statements. Usually there are a lot of ways to realize a coding task, nothing is black or white in coding.
You can have your opinion, of course, but please don't present it as a "law".
Thank you.
There is nothing wrong with NormalizeDouble() function, if used properly. This has been discussed and argued numerous times.
You have to form your own opinion. Mine is : there is no problem with NormalizeDouble if properly used.
I have never presented anything as law, just my opinion. I have never seen a use of it that is correct and have given multiple examples of why it was wrong.
It is you that are misleading people, stating that they can use ND. So they do, wrongly 99% of the time. Yes it has been " discussed and argued numerous times." Not once have I seen a valid use!
- Is it OK ... or ... could be better ??? Not understanding double comparison and to what appropriate epsilon. Unneeded usage.
- Round Number. Only one of four roundings, and implicit assumed. Explicit functions self-document rounding type wanted and to what value (not hiding it as a digit.)
MT4:NormalizeDouble - General - MQL5 programming forum
How to Normalize - Expert Advisors and Automated Trading - MQL5 programming forum - NormalizeDouble(Bid, Digits). Ticksize not Point. Wrong usage.
- ea work fine for all pairs exept on YEN pairs. You again say "There is no problem with NormalizeDouble(). It can be used, if done correctly. If you trade non-forex symbol it will not be sufficient to get a correct price." You show that is is wrong, depending on the symbol.
- Elementary Inquiry on Codes. "MathRound() and NormalizeDouble() are rounding in a different way," thus use is misleading. #2
- How do you solve the problem of invalid volume? Not rounding to lotstep, wrong usage.
- Help coding delete pending after Buy or Sell Execute. "there is nothing bad to use NormalizeDouble() is it suits your needs," No use in the thread.
- Storing 0.07 as a double - impossible??? Wrong use of ND, should use DoubleToString.
whroeder1:
Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it.
Never believe whroeder1 when he is babbling about NormalizeDouble().
If you say: "Be careful with normalizing Prices or Volumes by NormalizeDouble()" then you would be right. But if you say: " Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it." then you are just a clown.
I have never presented anything as law, just my opinion. I have never seen a use of it that is correct and have given multiple examples of why it was wrong.
It is you that are misleading people, stating that they can use ND. So they do, wrongly 99% of the time. Yes it has been " discussed and argued numerous times." Not once have I seen a valid use!
- Is it OK ... or ... could be better ??? Not understanding double comparison and to what appropriate epsilon.
- Round Number. Only one of three roundings, and implicit assumed. Explicit functions self-document type type wanted.
MT4:NormalizeDouble - General - MQL5 programming forum
How to Normalize - Expert Advisors and Automated Trading - MQL5 programming forum - NormalizeDouble(Bid, Digits).
- ea work fine for all pairs exept on YEN pairs.
- Elementary Inquiry on Codes.
- How do you solve the problem of invalid volume?
- Help coding delete pending after Buy or Sell Execute.
- Storing 0.07 as a double - impossible???
- x
The way you wrote it, with words in uppercase is like a law or whatever you want to name it.
Your way to present things is wrong and moderators will not let you continue to mislead people. That's it. I didn't expect you will understand, all has been said and still you can't see the obvious.
The only problem with NormalizeDouble() is that people use it to normalize volume or price, which is not the good way to do it.
The only problem with NormalizeDouble() is that people use it to normalize volume or price, which is not the good way to do it.
That is the obvious. Its use is always wrong. Reread #4 (I was still editing.) It is you that are misleading people. That's it.
Show me one use, just one valid use. When you can't, "you will understand," why I can't emphasize it ENOUGH.
That is the obvious. Its use is always wrong. Reread #4 (I was still editing.) It is you that are misleading people. That's it.
Show me one use, just one valid use. When you can't, "you will understand," why I can't emphasize it ENOUGH.
I will not start a new discussion. You already asked that question, I already answered. The problem is not NormalizeDouble(), I used it all the time, as a lot of other coders. The problem is your way to say things, let's people thing by themself !
You said it's not a law but an opinion. Ok then you can be sure sure everyone here know your opinion, please stop flooding the forum with your opinion. We are talking about coding opinion doesn't matter, only facts.
Forum on trading, automated trading systems and testing trading strategies
OrderModify error 1 during back testing
angevoyageur: However NormalizeDouble() function can be used to compare double.
whroeder1, 2014.03.05 15:19
Sure, it can. But then
- you run into Can price != price ? - MQL4 forum and those problems.
- You get people normalizing to Digits when price must be normalized to tickValue (not necessary equal to Point=10**Digits) therefor generally wrong.
- You get people normalizing to 0.01 when lotsize must be normalized to lotStep (not necessary equal to a power of ten) therefor generally wrong.
- it's an expensive call. MathAbs( v1 - v2 ) < Point/2 (equality) and v1 - v2 > -Point/2 (>=) are efficient, and explicitly show the equality test.
Sure, it can, but I recommend never use it for any reason.
- docs.mql4.com
Why is it do hard for you to see. I said "Sure, it can. But then" <problems>... What is why it should never be used.
The fact is use it and you code will eventually break. The fact is, its use is usually wrong. The fact is, it rounds wrong. The fact is, you blindly encourage people to write bad code by stating that it's ok. The fact is you want to sensor me for my opinion that I back up with facts.
Why is it do hard for you to see. I said "Sure, it can. But then" <problems>... What is why it should never be used.
The fact is use it and you code will eventually break. The fact is, its use is usually wrong. The fact is, it rounds wrong. The fact is, you blindly encourage people to write bad code by stating that it's ok. The fact is you want to sensor me for my opinion that I back up with facts.
Censor ? That's years I am trying to discuss with you. It was my last attempt for sure.
Your sentence about NormalizeDouble() will be considered as trolling, removed from new post and the author banned for not respecting moderator advice. The hundreds of old posts with your "opinion" will be left untouched, to demonstrate how you was censored.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use