Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 857
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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! There is a question in the code. This event appears on every new bar of the working TF. TF - should it be like this or is there an error in the code?
There is also Igor Kim's functionbool ExistPositions(), which returns the flag of position existence, which is a bit complicated for me to adapt to my specific conditions. But I don't think it will be tested in the story either.
If no one has a code, actually tested in the real world, to show me, I will try it scientifically. Thank you.
My knowledge is lacking again! A simple substitution in iOpen(NULL,0,0) for EURUSD produces errors undeclared identifier and implicit conversion from 'number' to 'string'. Same when changing Symbol() inOrderSend(Symbol(),OP_BUY,LOT,Ask,slippage,0,TP,"",magic,0,Blue); How do I fix it?
Again my knowledge is lacking! Just replacing NULL in iOpen(NULL,0,0) with EURUSD gives errors undeclared identifier and implicit conversion from 'number' to 'string'. Same when changing Symbol() in OrderSend(Symbol(),OP_BUY,LOT,Ask,slippage,0,TP,"",magic,0,Blue); How do I fix it?
Didn't you forget to put inverted commas?
Yes, that is how I imagined it, but I cannot check if it works on the history, because the opening of a position on the euro should take place by the condition for the pound and is not reflected in the code for the euro, while the history is displayed on the euro. Hence the uncertainty in the correctness of the decision.
Then I will have to learn MQL5 and test the multicurrency variant.
Then I'll have to learn MQL5 and test the multicurrency variant.
Oh no, thank you! I'm not aiming to study MKL4 or MKL5 thoroughly. My goal is to write simple Expert Advisors that are profitable in 95% of positions opened, and to avoid drawing the whole balance before I decide to close a position with a loss. I have several such Expert Advisors that work on demo accounts, but every time new ideas appear and I want to test them right away. I stick to the opinion that the simpler the code, the better, I do not want to delve into the language. Not yet anyway! A thorough study of the language is justified only with the purpose of earning money by writing experts to order, IMHO.
Thanks for the quotes. Haven't tried it yet, a bit later.
....... My goal is to write simple Expert Advisors for myself, which are profitable in 95% of open positions, and that a hanging minus does not drain my entire balance until I decide to close a position at a loss. .....
You have described the dream of 95% of traders around the world. But you don't even want to bother with the spelling and syntax of the language. Enviable self-confidence, I'd like that. IMHO of course.
Oh no, thank you! I'm not aiming to study MKL4 or MKL5 thoroughly. My goal is to write simple Expert Advisors that are profitable in 95% of positions opened, and to avoid drawing the whole balance before I decide to close a position with a loss. I have several such Expert Advisors that work on demo accounts, but every time new ideas appear and I want to test them right away. I stick to the opinion that the simpler the code, the better, I do not want to delve into the language. Not yet anyway! A thorough study of the language is justified only with the purpose of earning money by writing customized experts, IMHO.
Thanks for the quotes. I haven't tried it yet, I'll try it a bit later.
MQL5 is not any more complicated than MQL4. In some cases it is even simpler and faster. OOP is just a bugbear for beginners. In order to write a simple Expert Advisor you refer to, you don't need to know about OOP.
Tell me how much harder it is to write
// MQL5 #include <Trade\\Trade.mqh> CTrade trade; trade.Buy(lot);
You have described the dream of 95% of the world's traders. But you don't even want to bother with the spelling and syntax of the language. Enviable self-confidence, I'd like that. IMHO, of course.
I don't understand what you mean by "spelling", but it doesn't matter, because my robots do work, and in exactly the way I've described.
MQL5 is no more complicated than MQL4. And in some cases it is even simpler and faster. OOP is just a horror story for beginners. In order to write a simple Expert Advisor that you're talking about, you don't need to know about OOP.
Tell me how much harder it is to write
OH, MY GOD! You killed me. I don't understand anything, although mechanically it's not harder to write the second version )).
Hello, how long will MT4 be around for? a year or two?
Sorry for the question, it's a little off-topic (but very important to me).