Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1293

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
From two points on a line, you can find the price of an arbitrary third point on that line, also in the future (and vice versa).
Thank you! I will try it.
P.S. The only thing. I do not understand at a glance. Will it work in the Expert Advisor, in MT4?
Good afternoon!
Can you please help with an EA?
It makes trades on RSI signals from 30 and 70 levels in the appropriate direction, creates a grid.
I have a kind of stop loss % in it, but from time to time orders are hanging and will not close until I close them manually or until I sell the deposit.
I.e. such orders are opened, the price has already gone away for 5000 pips and beyond, but they are still hanging in the red.
You need to find the error. If this is not possible, we should insert a separate Stop Loss in pips into our EA.
I tried combining 2 EAs into one, but it didn't work with my skills.
Hello. Can you give me a hint? I need to get the number of points passed in the last tick. But I can't get it.
Hello. Can you give me a hint? I need to get the number of points passed in the last tick. But it's not working.
Try this.
Try it this way.
Hello again.
Please pay attention to a newbie's question.
I need to point out errors in the code, because in the tester, the Expert Advisor does not open orders...
The compiler does not show any errors or warnings, the same journal shows no errors...
Good day to all!
I am trying to mql4 to mql5.
Question: Why is mql5 calculating and displaying some unknown for me expression like 2.99999999 - (minus) 05 instead of the difference between current price and value of Hay variable, which should be <1 (like in mql4)?
How should I make mql5 correctly calculate the difference between these values? I normalize all values using NormalizeDouble(), but the above values
values are displayed unchanged. This is strange to me as both values are of doble type
Thank you all for your help.
Hello Ivan, no one scolds newbies here, on the contrary, they try to help. I am a beginner myself. Now, regarding your question. Several positions are opened because the check to open a position was performed but the check was forgotten to stop. The operator return returns control to the calling program (taken from the MQL5 Reference).
We must add return to the Expert Advisor code (highlighted in yellow):
In addition, to prevent the compiler from generating warnings, one more condition should be added in the Buy and Sell position opening conditions to check OrderSend(mrequest,mresult). This condition is defined by the if operator and should look like this:
One more thing should be taken into account. Sometimes, when moving from one trading day to another at 23:59:59, an opened position closes and then, at 00:00:00, a new position opens. This is so-called rollover close and rollover open, which depends on the particular forex dealer and its trading conditions. Search the forum, I've got some information about it somewhere.
Yours sincerely, Vladimir.
Hello.
Thank you very much for your reply! But I do not understand why do I need the return operator? There are two conditions in this code and the check should stop when one of them is fulfilled.
Or is it not?