maxvoronin74 #: Thank you. Got it. Does it only show today's prints or can it be configured to show prints for other days?
I've never asked that question as I've never needed to. Look on the site, maybe someone is already interested in something similar. Search for expert tab or something similar.
Good afternoon. Can anyone advise on the code, I make an advisor it should open from the current price of the deal to buy and sell, but the order of opening should be such that the deal Sell always above the deal Buy. But tried a lot of variations always get first buy and below comes sell. I tried to open at the current Buy and pending Sell after say 10 points. but to loop this function did not work Here is a code fragment
maxvoronin74 #: Thank you. Got it. Does it only show today's prints or can it be set to show prints from other days?
If you have a lot of prints, not all of them are displayed for today. But it's better to see the latest ones here. After all, you have to open the log file, but here you can see it at once.
harrison90 current price of the deal to buy and sell, but the order of opening should be such that the deal Sell always above the deal Buy. But tried a lot of variations always get first buy and below comes sell. I tried to open on the current Buy and pending Sell after say 10 points. but to loop this function did not work Here is a fragment of code
If it were possible, I would not be sitting here...
harrison90 current price of the deal to buy and sell, but the order of opening should be such that the deal Sell always above the deal Buy. But tried a lot of variations always get first buy and below comes sell. I tried to open the current Buy and pending Sell in 10 points, but I could not loop this function. Here is a code fragment
You probably mean the corridor between support and resistance levels? From the lower level - buy, from the upper level - sell. There are experts in the Market, I think even free ones, who offer such a feature. But you need to draw the levels yourself. There are indicators that suggest the direction of a deal with greater or lesser accuracy. The code can be based on them. .
MrBrooklin global variables different or approximately the same?
Apart from convenience in programming, does a custom structure have any other useful property?
Regards, Vladimir.
I am not a professional programmer, so do not judge me strictly and my answer may be inaccurate.
A structure is an OOP element. Unlike a simple variable, it contains several data types and allows you to describe some object. For example, we are programming a computer game and we need to describe a monster that has several lower limbs (int), several upper limbs (int), some strength (float, double), time of birth (datetime), coordinates in space and other characteristics.
You can create an array of structures, a structure element can also be an array or a structure. In some cases it is almost impossible to do without structures.
As for speed, I think that the difference with ordinary variables is minimal. You can test it - it is not difficult.
Grigori.S.B #: You can test it - it's not difficult.
Thank you. I was just thinking about this topic - why create a structure when you can easily do without it with global variables. Well, this is my unprofessional opinion.
I have a complete problem with speed measurement, as I have never done it and have no idea how to do it. ))
Thank you. I was just thinking about this topic - why create a structure if you can easily do without it with global variables. Well, this is my unprofessional opinion.
I have a complete problem with speed measurement, as I have never done it and have no idea how to do it. ))
Regards, Vladimir.
I can't imagine how you can implement the appearance of a new object with several different properties without structures / OOP. Disappearance of one of the old objects (for example, a monster was killed). Especially if the number of objects changes dynamically and is not known in advance.
There are a lot of examples of measuring speed / comparing execution of different code fragments here. The same saber posts several examples every day. 1. Create a high-resolution timer 2. Print its value before the operation is executed. 3. After the operation is executed. The difference is the time of the operation execution.
Do it for a regular variable and for a structure and compare.
//--- базовая структура для описания монстровstruct Animal
{
int head; // кол-во головint legs; // кол-во ногint wings; // кол-во крыльевbool tail; // наличие хвостаbool fly; // летаетbool swim; // плавает bool run; // бегает
};
further
//--- создадим объект базового типа Animal и опишем его Animal some_monster_small;
some_monster_small.head=1;
some_monster_small.legs=4;
some_monster_small.wings=0;
some_monster_small.tail=true;
some_monster_small.fly=false;
some_monster_small.swim=false;
some_monster_small.run=true;
и далее
Animal some_monster_bigboss;
some_monster_bigboss.head=3;
some_monster_bigboss.legs=8;
some_monster_bigboss.wings=1;
some_monster_bigboss.tail=true;
some_monster_bigboss.fly=true;
some_monster_bigboss.swim=true;
some_monster_bigboss.run=true;
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Thank you. Got it. Does it only show today's prints or can it be configured to show prints for other days?
I've never asked that question as I've never needed to. Look on the site, maybe someone is already interested in something similar. Search for expert tab or something similar.
Regards, Vladimir.
Thank you. Got it. Does it only show today's prints or can it be set to show prints from other days?
If you have a lot of prints, not all of them are displayed for today. But it's better to see the latest ones here. After all, you have to open the log file, but here you can see it at once.
If it were possible, I would not be sitting here...
.
Good day and good cheer everyone!
Questions from a beginner in programming:
- What is the fundamental difference between a user-defined structure and globally declared variables?
- Is the speed of accessing a structure and global variables different or approximately the same?
- Apart from convenience in programming, does a custom structure have any other useful property?
Regards, Vladimir.I am not a professional programmer, so do not judge me strictly and my answer may be inaccurate.
A structure is an OOP element. Unlike a simple variable, it contains several data types and allows you to describe some object.
For example, we are programming a computer game and we need to describe a monster that has several lower limbs (int),
several upper limbs (int), some strength (float, double), time of birth (datetime), coordinates in space and other characteristics.
You can create an array of structures, a structure element can also be an array or a structure. In some cases it is almost impossible to do without
structures.
As for speed, I think that the difference with ordinary variables is minimal. You can test it - it is not difficult.
You can test it - it's not difficult.
Thank you. I was just thinking about this topic - why create a structure when you can easily do without it with global variables. Well, this is my unprofessional opinion.
I have a complete problem with speed measurement, as I have never done it and have no idea how to do it. ))
Regards, Vladimir.
Thank you. I was just thinking about this topic - why create a structure if you can easily do without it with global variables. Well, this is my unprofessional opinion.
I have a complete problem with speed measurement, as I have never done it and have no idea how to do it. ))
Regards, Vladimir.
I can't imagine how you can implement the appearance of a new object with several different properties without structures / OOP.
Disappearance of one of the old objects (for example, a monster was killed).
Especially if the number of objects changes dynamically and is not known in advance.
There are a lot of examples of measuring speed / comparing execution of different code fragments here.
The same saber posts several examples every day.
1. Create a high-resolution timer
2. Print its value before the operation is executed.
3. After the operation is executed.
The difference is the time of the operation execution.
Do it for a regular variable and for a structure and compare.
and why would you create a structure
for example, to put it together,
/*struct PriceData { double open[]; double high[]; double low[]; double close[]; };*/or to create structures for monsters in the game
further
example from the help... names changed