Discussion of article "Step-by-Step Guide to Writing an Expert Advisor in MQL5 for Beginners" - page 25

 
MrBrooklin #:

Hello, Rustam!

Replace the code in both lines 195 and 241:

by the code:

Regards, Vladimir.

For the third time, right in the unitor, I correct the code of the EA to your updates, compile without errors, then rewrite all the new code directly to the one that was before, which from somewhere it is not clear yet how, updated to the old values, then once again check if it has not changed like this (automatically) and continue demotorg, on Insta. All dozens of open positions of the old code disappeared and normal work is going on. And so for the third time, I'm waiting for the fourth) On roboforex your updates work firmly, so far without returning to the old values. If you are familiar with this problem, please enlighten a dummy ? Before all the changes I removed old terminals with their records, with disc defragmentation, both of them, I really want to get to the bottom of this interesting thing) It appeared obviously recently, the whole forum could not have failed to notice it ?

 
Rustam Ayupov #:

If you are familiar with such confusion, please enlighten the dummy ?

Hello, Rustam! I am not familiar with such confusion.

Regards, Vladimir.

 
I ask for help from connoisseurs of incomprehension with the code of the Expert Advisor! The Expert Advisor changes two lines in the code on its own, at the whim and at an incomprehensible desire, so that instead of the condition of a single position, the previous state of unstoppable returns. waterfall of open positions, extra. After updating the code with a new one, the trading normalises, according to the code algorithm, but overnight the code returns the previous state again, on its own.... I update the code again and everything repeats again, after some time, already the third day... I have been on the market for a long time, but this is the first time I have met such a thing. The computer is personal, no one has access to it except me, is such an update possible remotely? I think I am not the only one who has met this miracle, can you help us? The advisor is unique, it would be a pity to abandon it.
 
Rustam Ayupov open positions, extra. After updating the code with a new one, the trading normalises, according to the code algorithm, but overnight the code returns the previous state again, on its own.... I update the code again and everything repeats again, after some time, already the third day... I have been on the market for a long time, but this is the first time I have met such a thing. The computer is personal, no one has access to it except me, is such an update possible remotely? I think I am not the only one who has met this miracle, can you help us? The Expert Advisor is unique, it would be a pity to abandon it.

Hello, Rustam! Open MetaEditor and save the EA code in the Experts folder under a different name, for example, Unique_EA. Then compile this EA and work with it under a new name.

Regards, Vladimir.

 
In the course of EA repair I found another version of this EA by this author, with another discussion on the same forum, on other links, he promises to finish it, apparently not everything is presented yet, everything is in English. Why doesn't the author add here links to all his clutter of information about the same thing? I'm trying to link here from another browser. There, too, the same errors... and the same errors.
 
Rustam Ayupov #:
In the course of EA repair I found another version of this EA by this author, with another discussion on the same forum, on other links, he promises to finish it, apparently not everything is presented yet, everything is in English. Why doesn't the author add here links to all his clutter of information about the same thing? I'm trying to link here from another browser. There, too, the same errors.

Rustam, if you are writing about this EA https://www.mql5.com/en/code/123 there are no errors in it.

There are only two warnings that can be easily corrected in line number 201 and 241. To do this, you need to add what is highlighted in yellow in the code:

201    bool check=OrderSend(mrequest,mresult);
.
.
.
241    bool check=OrderSend(mrequest,mresult); 

If you want only one position to be opened all the time, then in line numbers 189 and 229 add what is highlighted in yellow in the code:

189    if(Buy_Condition_3 && Buy_Condition_4 && PositionsTotal()==0)
.
.
.
229    if(Buy_Condition_3 && Buy_Condition_4 && PositionsTotal()==0)


Regards, Vladimir.

Simple Expert Advisor based on the Simple Moving Average and ADX
Simple Expert Advisor based on the Simple Moving Average and ADX
  • www.mql5.com
This simple Expert Advisor uses Simple Moving Average and ADX indicators.
 
MrBrooklin #:

Rustam, if you are writing about this Expert Advisor https://www.mql5.com/en/code/123 there are no errors in it.

There are only two warnings that can be easily corrected in line number 201 and 241. To do this, you need to add what is highlighted in yellow in the code:

Sincerely, Vladimir.

THANK YOU, this is the third variant, the second, already English-language, with English-language comments here https://www.mql5.com/en/articles/100 i.e. this second variant is essentially the same as the first one, so I saw the same errors there, which we corrected here. I don't know how it was tested and not noticed, but everything is corrected in the comments of the first variant, which I took here https://www.mql5.com/en/articles/100. The errors just appeared when testing it already in demotorg. Well, the terminal with this Expert Advisor is also weird, while we are sorting it out, the first miracle was the independent recovery of errors of the first variant, after some time from the beginning of the demo trading, which was corrected here, the second miracle was also the independent recovery of objects, after some time from the beginning of the demo trading, which I just erase manually. I will start testing your variant, it is different, apparently the author has fulfilled his promise and I did not see those errors that we have fixed here. His compilation is successful, I will take your suggestions into account, thank you, and I will test it, and then we'll see? However, the Expert Advisor is not suitable for real life, the algorithm, as it is, is unprofitable, I mean the first variant, but it should be thought out and improved, for example, add a trailing stop. Sorry for the speech, not boring ? I resumed forex after a long break, I forgot a lot of things).

Regards, Rustam.


Tested in the tester, trades are not opened, there is nothing to optimise...

In demo trades trades, positions open and close, unprofitable, but it works) Let's see what will happen before the end of the working week.

Step-By-Step Guide to writing an Expert Advisor in MQL5 for Beginners
Step-By-Step Guide to writing an Expert Advisor in MQL5 for Beginners
  • www.mql5.com
The Expert Advisors programming in MQL5 is simple, and you can learn it easy. In this step by step guide, you will see the basic steps required in writing a simple Expert Advisor based on a developed trading strategy. The structure of an Expert Advisor, the use of built-in technical indicators and trading functions, the details of the Debug mode and use of the Strategy Tester are presented.
 
Rustam Ayupov #:

Tested in the tester, trades are not opened, there is nothing to optimise...

Hello, Rustam!

Tested in the tester, all trades open, there is nothing to optimise!!! The code of the Expert Advisor is under the pictures.

Regards, Vladimir.


Files:
my_first_ea.mq5  25 kb
 
MrBrooklin #:

Hello, Rustam!

Tested in the tester, all trades are opened, there is a lot to optimise!!! The code of the Expert Advisor is under the pictures.

Regards, Vladimir.


In demotorg trades, trades open and close, unprofitable, but it works, and your Expert Advisor right now I will test, optimise and demotorg) THANK YOU.

Regards, Rustam.

 
Rustam Ayupov #:

In demotorg trades, trades open and close, unprofitable, but it works, and your EA right now I will test, optimise and demotorg) THANK YOU.

Regards, Rustam.

Rustam, this is not my EA. Its author is Samuel Olowoyo.

The only thing I have done in it is to amend the code so that 2 warnings do not appear during compilation and at your request I made it so that only one position is opened.

Regards, Vladimir.