Writing an effective advisor - page 7

 
PapaYozh #:


Not only that.

What's the other difference? Apart from access to data and trading functions, I don't see any difference.

 

I'll start by saying thank you to Vitaly for the work he's already done!

Now let's look at the video:

  1. I was surprised to see just a manual assistant instead of an automated EA. On the one hand, maybe this approach is the right one to begin with but something similar to Vladimir Khlystov's EA with manual trend line drawing written in MQL5 has been already implemented in CodeBase.
  2. I believe it is not quite correct to determine the trend the way it was shown in the video clip. In my post #7 I recommended to compress the five-minute chart to minimum for a reason. In that case it would be much easier to find two points where the trend line (or ray) should be attached. Especially since you now have the EA version used as a semi-automatic assistant.
  3. A strategy that opens a position on every bar is not needed at all. This is my personal opinion and it may not coincide with the opinion of the participants of this branch.

My suggestion:

  1. To continue developing the Expert Advisor, but this time in the MQL5 programming language.
  2. For the development, use a chart with the M5 timeframe, compressed to the minimum, as shown in the image in post #7.
  3. The Expert Advisor should determine the trend itself, i.e. in the automated mode, using two, or better, three points. These points can be clearly seen on the same picture in post #7. If necessary, I can show them on the chart.
  4. To close the position, apply a trailing stop or take profit (it would be better to provide the possibility to choose).
Regards, Vladimir.
 
Georgiy Merts #:

What's the other difference? Apart from data access and trading functions, I don't see any difference.

At a glance: StringTrimRight() , StringTrimLeft()

 
PapaYozh #:

At a glance: StringTrimRight() , StringTrimLeft()

Obviously rare exceptions that can easily be turned into general platform-independent functions. Anything more serious?

Agree that the order of trade requests is significantly different. And the difference in trimming blanks are minor things that don't even have to be "wrapped", you can get by with a conditional compilation.

 
Georgiy Merts #:

Clearly rare exceptions that can easily be turned into general platform-independent functions. Is there anything more serious?



Whether there is or not is to be found out when rewriting the code.

The point is that you will have to step on a rake before you can wrap such exceptions.

God only knows what the MQL developers are thinking, but it's not certain either.

 
PapaYozh #:


Whether or not there are any is to be found out when rewriting the code.

The point is that you have to step on a rake before you can wrap such exceptions.

God only knows what MQL-developers are thinking, but it's not for sure either.

Yes they are thinking normally. Such radical transitions are always associated with such inconsistencies. And the string processing functions are just a clear "design flaw" - in MQL4 and MQL5 they were apparently written in parallel and the interface has not been coordinated yet. The majority of general and string functions have a completely identical interface.

The differences in trade requests and data access... Fxsaber wrote a compatibility library... and it worked quite well.

But to be brutally honest, back in 2011, when MQL5 started supporting objects and conditional compilation, I definitely switched to portable code based on virtual interfaces. Since then I don't have any problems at all.

 
MrBrooklin #:

Good morning everyone and good mood!

Vitaliy, do you plan to write the code of your Expert Advisor only for MT4 or will there be a version for MT5? I do not know about 4 because I've had a short course of self-study of MQL5 programming language, that is why I will unlikely be able to add anything to your EA's code. Too bad!

Sincerely, Vladimir.

Please test it to see the minimum deposit you need for the minimum lot. I have no such information. I need to transfer money to a forex account now, and I can't do much. If there will be such information, you will not only me, you will do a big favor to many newbies.

There will be ideas, I can do the code myself. You may get some ideas, I may create the code myself. So, don't worry about coding.

I don't know MQL5 at all. I have never tried to use it, but I have understood that it is more complicated than 4 and I have no proper help. I had to spend hours on inventing the ways of getting around this or that limitation of the language in MT4 too. I didn't want to go through another hassle. MQL4 is more than enough for my needs. What I'm missing, I will finish using DLLs in Delphi. And I don't like 5-digit floating spreads.

 

The size of the take and stop can be set - the EA has these parameters. I tried to set a take=15 and tried 25 pips. It turned out to be much less effective than working without takeoffs at all. I did not set StopLosses at all, but you can, if you want, for example, let it be a certain amount of points away from the previous extremum.

I am planning to make a trawl. It is written in my code. I will place a simple one in my Expert Advisor in 5 seconds. I was making a trawl using fractals some time ago - I should look through the codes, so as not to invent it anew.

 
Vitaly Murlenko #:

Please test it to see what minimum deposit is needed for the minimum lot. I don't have that information. I now need to transfer money to a forex account, and I can't do much. If there will be such information, you will not only me, you will do a big favor to many newbies.

There will be ideas, I can do the code myself. You may get some ideas, I may create the code myself. So, don't worry about coding.

I don't know MQL5 at all. I have never tried to use it, but I have understood that it is more complicated than 4 and I have no proper help. I have been trying to use MT4 too and sometimes had to spend hours to invent a workaround to this or that limitation of the language. I didn't want to go through another hassle. MQL4 is more than enough for my needs. What I'm missing, I will finish using DLLs in Delphi. And I don't like 5-digit floating spreads.

*** myself... You have to write DLLs and still don't understand MQL5?

I'll repeat - MQL4 differs from MQL5 only slightly - there are major differences in access to data and in formatting of trade requests. But the M5 tester is head over heels better than the MT4 one.

It is strange to write an "effective Expert Advisor" and at the same time test it in MT4.

 

I'm running away from this MQL5 like the hell I am. Maybe there's something I don't know.

My kid's about to turn 4. I can't even program during the day - my kid won't let me... Anyway, I've been busy with MQL4 for the last few years ;)