Suggestions for improving the MetaEditor - page 10

 
Yedelkin:

I asked to give you an example.

Are you saying that if an indicator has 10 buffers, you can get, for example, the values of the seventh indicator buffer the day before yesterday with one line in MQL4?

Uh-huh,https://docs.mql4.com/ru/indicators/icustom
iCustom - Документация на MQL4
  • docs.mql4.com
iCustom - Документация на MQL4
 
Renat:
Gentlemen, the system of access to indicator buffers in MQL5 is many times more effective and faster than in MQL4.

I'm not talking about efficiency, I'm talking about usability.

I can't make a universal wrapper to call any indicator, every time I have to correct the copy and then I stumble over cumbersome code.

If it were different in 4, we wouldn't be discussing it at all.

 

The programmer's job is to solve problems efficiently, not to get a one-line solution that is slow in fact, but cheap for the programmer. In MQL4 there was no chance to get a quick mass access to indicator data, and in MQL5 there is such an access.

The Composter should stop posting nonsense. In fact the man doesn't realize that N calls in MQL4 are N synchronized and expensive calls in MQL5 compared to the one-time buffer request in MQL5 followed by instant access to the local array without synchronization. At least think about the cost of synchronization through critical sections on each history call in MQL4 and passing through a full cycle of access in a complex system function.

If you offer a solution that is several times more effective than the old methods, it will definitely be more profitable for the final result. Efficiency is more important.

 

I get it. Still no clear example :) Ok, let's move on. How to use your link to get a one line array of values of the tenth indicator buffer from the day before yesterday?

Key words: a) array, b) tenth indicator buffer. :)

 
Renat:

The composter needs to stop posting nonsense. In fact the man doesn't understand that...

Renate should learn to read. In fact, he doesn't understand either what is being written or what position the writers take.

If I explain the essence of a position I understand to another forum member, it does not mean that I adhere to that position. Moreover, I specifically clarified for the confused that"it's just a matter of habit" and there is no problem at all.

 
Yedelkin:

I get it. Still no clear example :) Ok, let's move on. How to use your link to get a one line array of values of the tenth indicator buffer from the day before yesterday?

Key words: a) array, b) tenth indicator buffer.)

Would you like me to copy it here? Here you go:

double val=iCustom( NULL, PERIOD_D1, "SampleInd", 9, 2 );

9 is the buffer index (the tenth one), 2 is the bar index.

Variable val is assigned to the value of the 10th indicator buffer the day before yesterday.

I just saw thearray in your question. You could have pointed out the need to get multiple values explicitly.

In this case, the answer is no, you cannot return an array by one string. But you can write a simple function that will do it. However, in this case there will be almost no differences from MQL5 - for each indicator you will have to write your own function.

 
I see your position as "one line is great and three is very bad".

You do not respond to technical explanations, you do not know the internal architecture of both terminals, you do not know the cost of calls, but you criticise the solutions of those who have not only created effective access methods, but also explain the reasons.
 

komposter:

Yedelkin:

komposter:

Yedelkin : You want to say that if an indicator has 10 buffers, you can get, for example, thevalues of the seventh indicator buffer the day before yesterday with one line in MQL4?

Uh-huh...


...Ok, let's go further. How can I use your link to get an array of the values of the tenth indicator buffer from the day before yesterday on one line?

Key words: a) array, b) tenth indicator buffer.)


I just sawan array in your question. You could have pointed out the need to get several values explicitly. In this case, the answer is no, you can't return an array by one line.

I see. Inattentive reading of my question about "values the day before yesterday" led to a wrong answer. So I had to use a tautology like "arrayof values" instead of "values". The correct answer is finally given: you can't return thevalues of the day before yesterday by MQL4 with a single line.

komposter:

Shall I copy it here? Here you are:

double val=iCustom( NULL, PERIOD_D1, "SampleInd", 9, 2 );

9 is the buffer index (10th), 2 is the bar index.

Variable val is assigned to thevalue of the 10th indicator buffer from the day before yesterday.

As you have already understood, the question was about the plurality of "the values the day before yesterday", and it wasn't said anywhere that thevalues the day before yesterday should be sought for PERIOD_D1 (especially if you consider that a daily period by definition cannot contain several values the day before yesterday for one buffer). Moving on. Of course I'm not an expert in MQL4, but the above-quoted line can't be formally considered correct. For the link you cited says that "The indicator line index. It may be from 0 to 7". But for some reason, without any further explanation, you quote buffer index == 9.

 
komposter:
Thank you for revealing the subject!
 
Renat:
I can see your position...

...you don't react... you don't know... you criticize...
Renat, find another mirror for your dialogue. Goodbye.