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

 
Alexey Viktorov:

Note in this post the words "All terminals have shared folders."


Search for information on how to do this and off you go... It's called folder linking.

So you can do this. Write a library and access this library from different terminals and they can exchange data or connect one robot to 2m terminals. I read a little bit about linking until I figured it out. Maybe there is a topic where you can ask more about it?

 
Seric29:

So you can do this. Write a library and access this library from different terminals and they can exchange data or connect one robot to 2 terminals. I read a little about linking until I figured it out. Maybe there is a topic where you can ask more about it?

I haven't seen the topic on the forum, but after looking at a few instructions, I find this one more understandable. I tried it, it worked, but I don't see the need to use it yet. Although I think it would be a good idea to combine the history from all terminals into one folder.

 
Alexey Viktorov:

I have not come across this thread on the forum, but after looking at a few instructions, I find this one more understandable. I've tried it and it works, but I don't see the need for it yet. Although I think that uniting history from all terminals in one folder would be nice.

Thanks for the advice. I used a hard link



, this requires the terminals to be installed in the same volume

, I stupidly added a unit then I merged the ex4 and mq4 files, in the end everything works on both sides now you can write shared libraries and use them. I don't know how reliable it is but I threw the robot on the chart counts. When I compile the code the files change on 2 sides, but update the calculations on one side, if I leave the robot to work in online mode I need the program to be the same and completed and compiled as will work unknown, maybe someone has the opportunity to check, I can not yet check.

 
Seric29:

Thanks for the advice. I used a hard link



, this requires the terminals to be installed in the same volume

, I stupidly added a unit then I merged the ex4 and mq4 files, as a result everything works on both sides now you can write shared libraries and use them. I don't know how reliable it is but I threw the robot on the chart counts. When I compile the code files change on 2 sides, but update the calculations on one side, if I leave the robot to work in online mode I need the program to be the same and completed and compiled as will work is unknown, maybe someone has the opportunity to check, I can not test yet.

So there is a magic folder directly in the compiler, or not suitable?


 
Seric29:

Thanks for the advice. I used a hard link

Why make links to specific files? Wouldn't it be better to make symlinks to folders and all files of this folder will be available in those terminals where these links are made?

That's a good idea:

In the picture 00.png, on the left side is the folder itself, and on the right side is a link from one terminal.

In image 11.png also, a link from another terminal

And on the image 22.png content, on the left side is a folder itself, and on the right side is content from a link.

Files:
00.png  102 kb
11.png  103 kb
22.png  118 kb
 
Vitaly Muzichenko:

So is there a magic folder right in the compiler, or is it not suitable?


I'm asking if it's possible to do this and if it will work reliably. The answer was no. I was advised some program and, of course, I messed around with it but it did not work. Then gave the advice of the command line, I spent 3 hours playing around and got something, but I do not know how it is not reliable first updates file date and contents, and then began to change only the contents and the date has not changed, it's a little strange. Where can I read about your method? How reliable is it, will the robots be able to communicate with each other online?

 
Alexey Viktorov:

Why make links to specific files? Wouldn't it be better to make symlinks to folders and all files of this folder will be available in the terminals where these links are made?

It's notable like that:

In the screenshot 00.png on the left is the folder itself and on the right a link from one terminal

Picture 11.png also has a link from another terminal

And on the image 22.png there is a content, on the left side a folder itself, and on the right side a link to the content.

I've seen it, sync via TotalComander, but as I understand it only transfers files (eg pictures), and if we are talking about that there is a text file and it changes, will it change if I add something to the file? How reliable is TotalComander's communication and can the robots communicate with each other online or is it just for writing code?

 
Seric29:

I've seen this, sync via TotalComander, but as I understand it only transfers files (like pictures), but if we're talking about a text file and it changes, will it change if I add something to the file? How reliable is the communication through TotalComander, will the robots be able to communicate with each other online or it will only be useful for writing code?

TotalComander is only for displaying the contents of two folders. It is more familiar to me than Windows Explorer. I also did all the symlinks on the command line. Only I used /D instead of /H and not a file, but a folder. And this link from different places has access to the same file.

Although, I was just wondering whether the file will be available when it is used by one terminal... Better contact Segei Tarbolin in person. As I understand it, he uses it and probably knows exactly.

 
Alexey Viktorov:

TotalComander is just for showing the contents of two folders. It's also more familiar to me than Windows Explorer. And I did all symlinks in the same way from the command line. Only I used /D instead of /H and not a file, but a folder. And this link from different places has access to the same file.

Although, I just now thought, but whether the file will be available when it is used by one terminal ... Better write in the personal Segei Tarbolin. As I understand it, he uses it and probably knows exactly.

I played with the Total Commander, in general, as I understand it, then there is only synchronization at the time of pressing the button is happening and through the console key H file content changes in real time, but when you click compile on the original calculations that the robot has made by reference are not changed, I have to press the compile button and the link, but if the robot is the same and not touch the code works, do not know if it will work online, not yet possible to test can bring down unfinished settings program. But since the files change the property I think should work. In general, here or through the console or the guy suggested something above, but I have not found the information normal. I'll write to the man that you advised.

 

Hi all, could you please tell me how to correctly rewrite the function from MQL4 to MQL5 :

//+------------------------------------------------------------------+
//Number of Sell_Order closed on the last bar
int Anz_g_Sell_Order()
{
int count = 0;
for(int i=OrdersHistoryTotal()-1; i>=0; i--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY) == true
&& OrderSymbol() == Symbol() && OrderType() == OP_SELL
&& OrderMagicNumber() == Magic_Nr
&& OrderCloseTime() > iTime(NULL,PERIOD_M15,0))
{
count++;
}
}
return(count);
}
//+---------------------------------------------------------------------+

I rewrote it, but it doesn't work for some reason, where is the error? :

//+------------------------------------------------------------------+
//Number of closed Sell_Order on last bar
int Anzahl_g_Sell_Order()
{
int count = 0;
if(HistorySelect(0,INT_MAX))
{
for(int i=HistoryDealsTotal()-1;i>=0;i--)
{
ulong ticket = HistoryDealGetTicket(i);
if(HistoryDealGetString(ticket,DEAL_SYMBOL) == _Symbol
&& HistoryDealGetInteger(ticket,DEAL_TYPE) == DEAL_TYPE_SELL
&& HistoryDealGetInteger(ticket,DEAL_ENTRY ) == DEAL_ENTRY_OUT
&& DEAL_ENTRY_OUT > iTime(NULL,PERIOD_M15,0))
{
count++;
}
}
}
return(count);
}
//+---------------------------------------------------------------------+