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

 
Hello, I want to know if there is a normal script to download and synchronize the quotes history for MT5.ex5 and everything was fine, the scanner worked, gave signals, everything worked fine, but yesterday after lunch as cut off, the scanner just stopped seeing the history and therefore look for entry points according to strategy and give signals, I thought the matter is in the scanner, but i got a few versions of it and stopped displaying signals on all of them, i got my friend and i cleared the terminal, it was useless, i deleted it with all the information, reinstalled it and when i started to load the history with the script i opened the experts tab and saw that there were only errors when loading history, i wrote to the broker support, they told me that recently the engineers of MT% had updated something and maybe the script algorithm got out of order i tried to ask here what to do and if there are other scripts for the quotes history, i should tell right away that i tried to use one-month timeframe to download the quotes, it was useless, thanks a lot in advance.
 
82Dmitry82:
Hello, I would like to know if there is a normal script for loading and synchronization of quotes history for MT5.ex5 and everything was fine, the scanner worked, gave signals, everything worked fine, but yesterday after lunch as cut off, the scanner just stopped seeing the history and therefore look for entry points according to strategy and give signals, I thought the matter is in the scanner, but I have a few versions of it and stopped giving out signals for all of them, both for me and my friend, I emptied the terminal, to no avail, deleted it with all the information, reinstalled it and when I started loading history with the script, I opened the experts tab and saw that there were only errors when loading history, I wrote to the broker support, they replied that recently in MT% that might have been updated and the algorithm is confused in the script, he gives out such a loading history,i apologize for the large number of letters, i just tried to explain the situation in detail, broker support refused to help, they say it's not us, and metaquotes, you can not write to them, they have no feedback, so i decided to ask here what to do and whether there are other scripts for quotes history, i must admit i tried using monthly TF to download quotes, no use, thanks in advance.

I am not going to say anything, but this is the only company where I had problems with historical data when fulfilling one of my orders - it was on and off.

I was searching for the reasons until I told the client to test it on quotes from other brokers. And everything turned out to be OK there.

If you've tried to load the quotes in monthly timeframes, it was useless.

 
 

you don't have a complete example, post the reproducible code, i.e. a complete class template and a code example in which you create an object using this template, so far only "telepaths on holiday" .... i suspect that the code simply does not compile, many points of contention in your template, i may not see the logic in it

 
Artyom Trishkin:

I am not going to say anything, but this is the only company where I had problems with historical data when fulfilling one of my orders - it was on and off.

I was searching for the reasons until I told the client to test it with quotes from other brokers. And everything turned out to be OK there.

The reason is that it is forbidden to discuss brokers on this resource, let's leave it at that.

That's the thing, they haven't had a problem in over half a year. I tried to use it because of some reason, ours uses a makdi bargraph, it seems to be the problem, at least when they wanted to order for QuickBooks the answer was negative after reviewing TOR, all rested on the built-in induks platform, just IMb sometimes in hibernation and America gives to work

 
Igor Makanu:

you don't have a complete example, post the reproducible code, i.e. a complete class template and a code example in which you create an object using this template, so far only "telepaths on holiday" .... I suspect that the code simply does not compile, there are many questionable points in your template, maybe I do not see the logic in it

It should work like this.

#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

#define  templ(T)          template<typename T>// задача данного макроса определять int bool double и т.д

//Далее пишем макрос который будет принимать массив и возвращать
//результат с помощью вызова перегружаемой функции которая будет вызываться из класса, но в моём примере вписана простая функция,
// я 3 дня посидел и выяснил что макрос может принимать массивы любой размеренности  в принципе об этом написано в справке что макрос может принимать эл. любого типа
#define  Vosmas(a,b,c,d,e) /*return*/(Fun(a,b,c,d,e))//a- массив, 
                                                    //b- номер строки если нужен
                                                    //c,d- номера измерений если нужны и массив многомерный

int Mas[2],Mas2[2][2],Mas3[2][2][2];//объявил массивы которые будут хранить информацию// обработка с помощью классов должна быть любого типа templ(T)

int OnInit()
{int Perem=0;
//макрос должен вызвать функцию из класса и сделать следующее/ в моём примере будет простая функция
 Perem=Vosmas(Mas,0,0,0,3);
 Print("Vosmas: ",Perem);//результат 3
return(INIT_SUCCEEDED);}

templ(T)class CData{
public:CData(){};~CData(){};
       //перегружаемая функция Total() с наращиваемым количеством аргументов, не знаю будет ли оно наращивать аргументы вроде записывается но когда дойдёт до расчётов увидим
       //хотелось бы с этим разобраться 
       //а также делать такую перегрузку 
       T Total(T &mas[]    ,int y1=0 ...){return(mas[y1]);}  //y2 весит в холостую  
       T Total(T &mas[][]  ,int y1=0 ...){return(mas[y1][y2]);}
       T Total(T &mas[][][],int y1=0 ...){return(mas[y1][y2][y3]);}};
       
         
templ(T) T Fun(T &a[],int b,int c,int d,int e){a[b]=e; return (a[b]);}// оставшиеся аргументы будут висеть в холостую

In general I want to achieve this effect, but no experience in the area of classes. The code compiles and works

 
Seric29:

It should work like this.

Unfortunately I don't understand the logic of this code, I can't even imagine why you would declare language keywords by macro substitution,

And by logic, I doubt you get access to a multidimensional array this way, I think your example just didn't compile a template and therefore you didn't get a compile-time error,

I'm not much help, maybe someone else can figure out your example

 
Igor Makanu:

Unfortunately I don't understand the logic of this code, I can't even imagine why you would use macro substitution to declare language keywords,

And by logic, I doubt you get access to a multidimensional array this way, I think your example just didn't compile a template and therefore you didn't get a compile-time error,

I'm not much help, maybe someone else can figure out your example.

The code compiles but it's not finished, the point is to get this result

return(mas[y1]);

I need to call a function from the class and get this value.

 
Seric29:

The code compiles, but it's not finished.

again: just because you didn't get a compile error doesn't mean your template class was included - where is the object of the CData class ? - I see a template declaration, where is the variable? - object ?

if you "vitally need" to solve the question, then make fully reproducible code - completely it's without ..... comments at your discretion and again, I don't understand the logic of using macro substitution

#define  templ(T)          template<typename T>

maybe that's the "gist", I rarely use macros, at least if I use a macro I understand what it eventually does, in your example it's a mystery to me

 
Igor Makanu:

again: just because you didn't get a compile error doesn't mean your template class was included - where is the CData class object ? - I see a template declaration, but where is such a variable? - object ?

if you "vitally need" to solve the question, then make fully reproducible code - completely it's without ..... comments at your discretion and again, I don't understand the logic of using macro substitution

maybe that's the point, I rarely use macros, at least if I use a macro I understand what it eventually does, in your example it's a mystery to me

The task of macro calling a function from the class and pass the value to the function and since macro can take an array of any dimension I'm trying to make such a scheme. Of course a lot of gems, but I need to call the function from the class and I do not know how to call a simple function of the class (in my case, the method Total has no description) is not written in Help, there are complex examples of transfer.

#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

#define  templ(T)          template<typename T>// задача данного макроса определять int bool double и т.д

#define  Vosmas(a,b,c,d,e)  5

int Mas[2],Mas2[2][2],Mas3[2][2][2];//объявил массивы которые будут хранить информацию// обработка с помощью классов должна быть любого типа templ(T)

int OnInit()
{int Perem=0;
Perem=Vosmas(Mas,0,0,0,0);
Print("Vosmas: ",Perem);
Perem=Vosmas(Mas2,0,0,0,0);
Print("Vosmas: ",Perem);
Perem=Vosmas(Mas3,0,0,0,0);
Print("Vosmas: ",Perem);//во всех случаях результат 5
return(INIT_SUCCEEDED);}

Here is an example a macro takes an array of any dimension, it is bad that developers have cut these features normal work with complex elements

You can do it without a template, but it's better with a template.