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

 
Nauris Zukas:

Again, what's that got to do with it?

Simply because I don't know what you want to get. You're showing me pictures. I don't like comics - it's not our thing - it's American. They're the ones who can make sense out of a Spider-Man on a rope upside down. Here you have to tell it in Russian.

 
Artyom Trishkin:

It means that the architecture of your program is wrong from the beginning, since you have such problems when making changes.


It's not the problems, it's the effort involved.

How can you ever judge what you don't know...

 
Aleksey Vyazmikin:

It's not the problems, it's the workload.

How can you ever judge what you don't know...

Experience tells you. Right now you're too lazy to work on keeping it simple - so it's only going to get harder from here ;)

 
Artyom Trishkin:

Experience tells me. Right now you're too lazy to work hard to make it easy - so it's only going to get harder ;)


I'm happy with what I have! What's that got to do with laziness and effort? I've got 17k lines of EA code, not counting a dozen classes...

 
Artyom Trishkin:

Your pictures are out there somewhere... Why should someone who has decided to help you run there? If you don't want to make it easy for the person helping you and yourself, keep making people jump around the pages looking for your posts that only you want.

What have you circled there? A picture? Do you think everyone has a clip-comic mindset these days? Is it difficult for you to simply write in words what you are doing and what you want to achieve as a result?

I have already described it in words and added a picture for easy understanding.
Those who decide to help will always see what it is all about and not just leave a comment for an unsubscribe. This is not the first time I have encountered you, Artyom Trishkin.

 
Nauris Zukas:

I have already described it in words and added a picture to make it easier to understand.
Anyone who decides to help will always see what it is all about and not just leave a comment to unsubscribe. This is not the first time I have encountered you, Artyom Trishkin.

As you wish. I wanted to help.
 
Aleksey Vyazmikin:

I'm happy with what I have! What's that got to do with laziness and effort? I have 17k lines of EA code, not counting a dozen classes...

So you see, very small changes require much effort. So it is not optimal from the very beginning. The point is not the number of code lines but making changes in it in a very cheap way.
I, for example, have a program of 50k lines or more, which doesn't require a huge amount of work to make changes. You only have to specify the right conditions in the method of the required class.
 
Artyom Trishkin:
So you see, very small changes require a lot of efforts. So it is not optimal from the very beginning. It's not about the number of lines of code, but about making changes in it easily and inexpensively.
I, for example, have a program of 50k or more lines which doesn't require a huge amount of work to make edits. It's enough just to specify the right conditions in the method of the right class.

It seems to me that our conversation is not about anything.

I am saying that it is convenient to have only one function at initialization to implement the most needed task - to hide indicators when selling the EA.

And you keep trying to explain to me that my code is bad when you haven't even seen it once. Of course, it is not perfect, but it is not as primitive as the one in the Help.

 
Aleksey Vyazmikin:

It seems to me that our conversation is not about anything.

I'm saying that it is convenient to have only one function at initialization to implement the most demanded task - hiding indicators when selling an Expert Advisor.

And you keep trying to explain to me that my code is bad when you haven't even seen it once. Of course, it is not perfect, but it is not as primitive as the one in the Help.

You make an indicator object. In the class constructor you set indicator visibility after testing. You pass its visibility to the method that creates the new indicator. And you don't need to run through 17 lines of code ;)
That's it, without seeing it at first glance, but from your explanations, having a bit of an idea.
 

How to add a First/Previous function to an already ready-made indicator. That is, edit it.

Everyone says it's

int OnCalculate (const int rates_total,
const int prev_calculated,
const datetime& time[],
const double& open[],
const double& high[],
const double& low[],
const double& close[],
const long& tick_volume[],
const long& volume[],
const int& spread[])
{

You should replace this with

int OnCalculate (const int rates_total,
const int prev_calculated,
const int begin,
const double &price[])
{

But all this does not give results. It might help to write rather than edit.

Please tell me how to write this function!?? if you can in more detail.