[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 644

 
itum:


I already did it this way, but in the future I will also receive signals and the order will not open by the signal at all. It seems to be a simple thing, but I cannot figure out how to do it! Help!

How do you do it? GA

If we check for the presence of such a position in the market, it will be done. Until it closes, there will be no new position. If we check, for example, for the time after the position opening, then after a set interval has passed and the signal is present, the position with the same magic number and the same parameters will open again in addition to the existing one.

After all, you now have a set of positions opened (one at each tick) with the same parameters. You need them to open, but not so often. Open them either by time or on a new bar, or after a specified number of bars...

 
My friends, please advise me where I can read about code optimization. I searched the site - the only thing I came across was optimization of Expert Advisors. Of course, I'm not a good tracker... I really need it. Testing in visual mode slows down really badly, that is why I am interested in advice on code optimization, what to replace logical constructs with, and better of all, how to do it with examples, etc. I am also very interested in advice on code optimization. Where can I read?
 
artmedia70:
My friends, advise me where I can read about code optimization. I searched the website and found only information on optimization of Expert Advisors. Of course, I am not such a good tracker... I really need it. Visual testing slows down very badly, that is why I am interested in advice on code optimization, what to replace logical constructs with, and better of all, how to do it with examples, etc. In other words, I want to know how to optimize an EA. Where can I read?

I also wondered about it, but did not find anything useful. When it comes to optimization, you already know about the great brake of iCustom :), in indicators there is a restriction on the number of bars, that can be calculated (through IndicatorCounted() or by the number of bars). In the code, there is no sense to bother with the number and complexity of different constructions like if, while, etc. You won't gain much, but with time and experience, the code will become more "beautiful". Well, in visualization mode, when every "bounce" is modeled, it will be slow almost in any case (depending on complexity of the system, of course). Somewhere I read that if complex calculations in a dll, it will be faster, but I have not checked it. With dll, also enough nuances.

 
itum:


I already did it this way, but in the future I will also receive signals and the order will not open by the signal at all. It seems to be a simple thing, but I cannot figure out how to do it! Help!

How do you do it? GA

Well that depends on the architecture of the EA itself. Throw in the code, let's see.

 
ToLik_SRGV:

I also wondered about it, but did not find anything useful. When it comes to optimization, you already know about the great brake of iCustom :), in indicators there is a restriction on the number of bars, that can be calculated (through IndicatorCounted() or by the number of bars). In the code, there is no sense to bother with the number and complexity of different constructions like if, while, etc. You won't gain much, but with time and experience, the code will become "nice" itself. Well, in visualization mode, when every "bounce" is modeled, it will be slow almost in any case (depending on complexity of the system, of course). Somewhere I read that if complex calculations in a dll, it will be faster, but I have not checked it. There are enough nuances with dll, too.

I am, of course, ashamed of my ignorance, but I still do not know how to insert the code of indicator in the Expert Advisor code, so I do not have to deal with iCustom. I would like to read a good article on this subject somewhere, with some examples - to bake an indicator in sauce and wrap it directly in an EA. It would be great... I still use some useful but slow custom indicators...
 
artmedia70:
My friends, please advise me where I can read about code optimization. I searched the site - the only thing I came across was optimization of Expert Advisors. Of course, I'm not a good tracker... I really need it. Visual testing slows down very badly, that is why I am interested in advice on code optimization, what to replace logical constructs with, and better of all, how to do it with examples, etc. In other words, I want to know how to optimize an EA. Where can I read?
If i have already mentioned this, i would like to ask them to open a visual trading Expert Advisor and use its function to delete graphical objects after order closing/deleting, i.e. i look for graphical objects by the given number of last ticket.For example, we look for graphical objects and delete them by a given number of last ticks. The function used to work every tick (I didn't think it could lag) with ten EAs at different pairs and it led to incredible lags, i.e. constant access to order history is too expensive ... So, it looks like a trifle but needs optimization - either use it less often or keep your own history ...
 
artmedia70:
I am ashamed of my ignorance, but I still do not know how to insert the indicator code into the Expert Advisor code, so I don't have to bother with iCustom. I would like to read a good article on this subject somewhere, with some examples, like - let's bake an indicator in sauce and directly wrap it in an Expert Advisor. It would be great... I still use some useful but slow custom indicators...


https://www.mql5.com/ru/articles/1456

https://www.mql5.com/ru/articles/1457

https://www.mql5.com/ru/articles/1463

+ search for "transfer indicator"

 
artmedia70:
Wow, huge!!!

Once you've worked out how to transfer the indicator to the EA, don't be in a hurry to put it into practice. in this case you need to weigh everything up very carefully. the EA and the indicator are separated from each other for a reason.
 
DDFedor:

The EA and the indicator are separated from each other for a reason.
You are talking in riddles... :):)
Reason: