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

 
Sergey Likho:

New, delete are not used. Class elements are declared at the beginning and I don't recreate them.

Mostly a lot of work is done with arrays.


What aretest-case scripts ?

You make a class and probably (even before) write a bunch of scripts (or one or two scripts and a lot of testing functions) which check that it does exactly what it's supposed to do and that's how it works and that's it's usability.
At the same time it checks for stability, bugs and memory leaks.

You don't have to debug a class on a huge complex with many others like it.

----

If you work a lot with arrays, periodically output the array sizes to the external log and see which one bloats to an unimaginable size while working.

By the way, recursive calls may cause out-of-memory if there are arrays inside. Check that there is no recursion or that it is properly limited.

 
Can you tell me what to study to learn how to exchange data between charts in mt4, and between terminals (not via internet) ?
 
Yevhenii Levchenko:
Please advise, what do I need to learn to exchange data between charts in MT4, as well as between terminals (not via internet)?
If between charts then EventChartCustom, global variables of the terminal, file, winapi.
If between terminals then file and winapi
 
Yevhenii Levchenko:
Please advise, what do I have to study to learn how to exchange data between charts in mt4, as well as between terminals (not via internet)?

A file can be usedbetween terminals on the same machine via the "Common" folder

If I'm not mistaken, the address is: C:\Users\<....>\AppData\Roaming\MetaQuotes\Terminal\Common\

 
Vladimir Simakov:
If between charts, EventChartCustom, terminal global variables, file, winapi.
If between terminals, file and winapi
Vitaly Muzichenko:

Between terminals on the same machine, you can use a file in the "Common" folder

If I'm not mistaken, the address is: C:\Users\<....>\AppData\Roaming\MetaQuotes\Terminal\Common\

Turns out it's not all that complicated (I mean, only winapi is complicated)! Thanks ! :)

 
Alexey Viktorov:
Line 61, which line is it?
Can't tell right now, it's on the VPN, can't access it yet
 
Ivan Butko:
Can't say right now, it's on a VPS, can't access it yet

Is the source on a VPS? You don't have it on your computer? Okay, not interested anymore.

 
Alexey Viktorov:

Is the source on a VPS? You don't have it on your computer? OK, not interested anymore.

Okay. (chuckles)
Yeah, I'm just off the computer.

 
In general, the situation is as follows. There are several "lots" Lots1, Lots2, Lots3, and so on. At each stop the lot changes. I cannot multiply the lot using Martingale, they are all different. I tried to adapt standard functions FindLastLot() and others. It turned out very cumbersome and abnormally worked. That is, for each lot I have prescribed OrderSend and a heap of functions which prevented parallel opening of other orders. Then I decided to try using the while loop and attach switch case to it, but I remembered that it only works with integers. I thought we could use the for loop, but the orders are closed, hence, they have to be searched for in closed positions. But how? I need to write one more loop, i.e., for and while in it? I have only questions... I searched for answers on the forum and on the Internet, too. Everything is banal. All the same Martingale multiplied by two. I have only hope for you, MQL masters. Can you tell me the direction to go in?
 
Corvin85:
In general, the situation is as follows. There are several "lots" Lots1, Lots2, Lots3, and so on. At each stop the lot changes. I cannot multiply the lot using Martingale, they are all different. I tried to adapt standard functions FindLastLot() and others. It turned out very cumbersome and abnormally worked. That is, for each lot I have prescribed OrderSend and a heap of functions which prevented parallel opening of other orders. Then I decided to try using the while loop and attach to it a switch case but I remembered that it only works with integers. I thought we could use the for loop, but the orders are closed, hence, they have to be searched for in closed positions. But how? I need to write one more loop, i.e., for and while in it? I have only questions... I searched for answers on the forum and on the Internet, too. Everything is banal. All was just Martingale multiplied by two. I have only hope for you, MQL masters. May you advise me in what direction to go?
I have a feeling, that the original text comes from parallel universe, has been translated twice by google-translate and then retold by Alice :-)