Beta version of the online book on MQL4 programming - by Sergey Kovalev (SK.) - page 7
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
I would also wonder why the text uses functions without brackets OrderType() OrderOpenPrice()
Or could it fail, for example, if the price suddenly approaches the TP and suddenly changes by several pips in one tick, jumping over the TP?
This is theoretically possible. That is, the order will still be closed, but it may be closed not at the TP price, but at the first price that appears.
I think you may be interested in reading the MQL4 Tutorial - Trade Operations - Order Parameters and Trading Operations Rules. It deals with a similar example with slippage.
Another original feature at the stage of learning programming - all the time to put a comma I press the letter b, where there is a comma in the English layout))). It turns out that you write in Russian, but when you put a comma you forget that the Russian layout.
That's why many people write software in English, without using Russian, it's faster and easier, the layout doesn't change that often, and then the program is adapted to Russian for someone else, if comments are required, just in this period of work, it's most convenient to russify, for some reason:) English layout is the basis for people who are engaged in such writing, the Russian is used at a very minimal scale, if you estimate % usage of English layout, it's 99% of the time. I used to want to write programs in Russian, but after having fun with 1C this desire has evaporated.
The problem is found out, we will fix it.
Now I can see the drawings at https://book.mql4.com/ru/metaeditor/compose
I wonder how you got my messages to disappear. It's not a fair discussion, guys. If you have nothing to say, say so. I understand.
I only hope that those to whom I wrote have read and responded
I have implemented this function in the editor and created an indicator. I did not add or subtract anything. But during compilation, I got so many errors. They are horrible. Then I tried to create an Expert Advisor using this function only. I got the same result.((
What is wrong here? Why is it screaming about errors?