Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1033

 
Roman Kutemov:
Yeah, yeah. There's no need to complicate life)).
After mt4, it's hard to move in at all.

The main thing is not to turn off your head and not to use ready-made solutions. And everything will succeed. Otherwise the transition to the category of lego-programmers is inevitable.

 
Alexey Viktorov:

The main thing is to keep your head and not to use ready-made solutions. And everything will work out. Otherwise the transition to the category of lego-programmers is inevitable.

I'm afraid even you are unable to pass the initial trade check by your own decision. The recommendation is therefore questionable.

 
fxsaber:

I'm afraid even you are unable to pass the initial trading test by your own decision. The recommendation is therefore questionable.

Note: I have not said a word about your code. And you made up "initial trade check" in response, what is that and what do you eat with it? I have always said and will always say that one should not use ready-made other people's solutions, otherwise the transition into the category of lego-programmers is inevitable.

 
Alexey Viktorov:

Note: I haven't said a word about your code.

Similarly. There are certain places in MT5 where you have to be very competent to write yourself.

And you made up "initial trade check" in response, what is that and what do you eat with it?

Here's about it.

I always said and will always say that one should not use ready-made other people's solutions, otherwise the transition into the category of lego-programmers is inevitable.

It is incorrect to recommend writing the same AlgLib from scratch. Lego is often a good thing.

Обсуждение статьи "Библиотека для простого и быстрого создания программ для MetaTrader (Часть V). Классы и коллекция торговых событий, отправка событий в программу"
Обсуждение статьи "Библиотека для простого и быстрого создания программ для MetaTrader (Часть V). Классы и коллекция торговых событий, отправка событий в программу"
  • 2019.04.11
  • www.mql5.com
Опубликована статья Библиотека для простого и быстрого создания программ для MetaTrader (Часть V...
 
Alexey Viktorov:

I have always said and will always say that you should not use ready-made solutions, otherwise the transition into the category of lego-programmers is inevitable.

the ability to read and use other people's software solutions is always a plus in a programmer's karma,

and reinventing your own bikes is a waste of time and self-deception that "my solution is the right one!

HH: You always use other people's ready-made solutions, starting from MQL built-in functions and ending with the fact that you will always copy the programming logic of those authors of books (articles), from which you started studying the programming language

ZS:https://www.mql5.com/ru/code/25166, you are a lego programmer! correct it urgently:

#include <Trade\Trade.mqh>

CTrade trade;
Советник 4UJ
Советник 4UJ
  • www.mql5.com
Рекомендаций по валютной паре нет. Используемые индикаторы: Простая скользящая средняя с периодом 48 — SMA(48). Индикатор ATR с периодом 7 и MA по ценам ATR с периодом 30 Условия для покупок: 1. Цена находится выше скользящей средней. 2. Индикатор ATR пересекает свою скользящую среднюю снизу вверх. 3. Как только сформируется первая медвежья...
 
Vitaly Muzichenko:

Then the problem will go away.

You can also specify the size of the array, in this case 1 element

Thanks for the reply.

It seems that the problem is gone, but the main problem for me is the error

Failed to copy data from the handle_Regressor indicator, error code 4806

that occurs when calling this indicator while the EA has been working normally for half a day.

Code in EA for calling the indicator

//+------------------------------------------------------------------+
//|значение Regressor Номера буферов: 0 - Up, 1 - Center, 2 - Low    |
//+------------------------------------------------------------------+
double Regressorf(int Bufer,int index)
  {
   double MA[1];
   ResetLastError();
   if(CopyBuffer(handle_Regressor,Bufer,index,1,MA)<0)
     {
      Print("handle_Regressor: Bufer=",Bufer," index=",index);
      PrintFormat("Failed to copy data from the handle_Regressor indicator, error code %d",GetLastError());
      return(0.0);
     }
     Print("handle_Regressor: Bufer=",Bufer," index=",index, " arr=",MA[0]);
   return MA[0];
  }

I even don't know what to do, the indicator doesn't report any error and I cannot figure out what's wrong!

The error is catching only with real data - I don't see it in the tester.

P.S. Found an error in the indicator in the logs - I will now make some changes and see if there is another error.
 
Igor Makanu:

The ability to read and use other people's software solutions is always a plus in a programmer's karma,

Don't go to extremes. I'm not talking about reading and understanding other people's code, especially the code of a standard library. Although it's so crammed in there...

If I hadn't been born before me, I would have probably written a trade library for personal use.

 

fxsaber:

is often good.

Often is not absolutely always, and you advertise your handiwork even where it is not necessary, not realising that your code is more difficult to read than a chinese alphabet. That's the end of the dialogue.

 

Hello, can someone explain in a clear way what are"Plots" in MQL5? They are not related to buffers, but the indicator_plots property creates a list of drawing object properties similar to buffers. When using MQL4 tools, it was clear that reference was made to a specific drawing object, and now there is a new preprocessor propertyindicator_plots that defines the number of what is unclear.

 
The_Sheikh:

Hello, can someone explain in clear terms what are"Plots" in MQL5? They are not related to buffers, but the indicator_plots property creates a list of drawing object properties similar to buffers. When using the MQL4 tools, it was clear that a reference to a specific drawing object is under reference, but now there is a new preprocessor propertyindicator_plots that defines the number of what is unclear.

Probably, it would be easier to understand if we run this indicator in MT4 and MT5. When converting to MT5 I had to use plots

Forum on trading, automated trading systems and strategy testing

Indicators: Equity Chart

fxsaber, 2019.04.25 11:25

#property indicator_separate_window
#property indicator_buffers 6
#property indicator_plots 2

Because only two buffers should be drawn.
Reason: