Reading indicator buffers set to chart - page 8

 
comp:

The answer (quoted in full):

Fucking hell! You can see the indicator on the chart, but we won't let you get its values - once again you have confirmed your role.

I do not understand what all the fuss is about. It's already written, what if there are several similar indicators on the chart? From which one should we read? Do they have to be numbered?

Second, do you have any idea how deeply we will have to modify the whole system of working with indicators to satisfy this unnecessary fad?

We can only think that we will just give it a tweak and trim the code here and there and everything will work. It will not, alas.

There is no need to touch something that is working stably.

 
Andrey Khatimlianskii:

Then why compare them?

Same reason as comparing logically different MAs and RSIs, for example.
 
Alexey Volchanskiy:

I don't understand what all the fuss is about. After all, it has already been written, what if there are several of the same indicators on the chart? From which one should we read? Do we need to number them somehow?

They are already numbered even in MT4. SeeChartIndicatorName and ChartIndicatorsTotal.

Second, do you have any idea how deeply we will have to rework the whole system of working with indicators to satisfy this unnecessary fad?

We will not have to change anything. You can easily do it with GetPtr without interfering with the architecture. We only need to add the possibility without using DLL, by excluding the external writing to the buffer.

iCustomChart

Returns numericalvalue of the specified custom indicator in the specified chart.

double  iCustomChart( 
   long  chart_id,      // идентификатор графика (аналогичный, как в ChartIndicatorName)
   int   sub_window,    // номер подокна (аналогичный, как в ChartIndicatorName)
   int   index,         // индекс индикатора в списке индикаторов, добавленных к данному подокну графика (аналогичный, как в ChartIndicatorName)
   int   mode,          // источник данных (аналогичный, как в iCustom)
   int   shift          // сдвиг (аналогичный, как в iCustom)
   );

Parameters

chart_id

[ID of the chart. 0 means the current chart.

sub_window

[in] Subwindow number of the chart. 0 means the main chart window.

index

[in] Index of the indicator in the list of indicators. Indicators are numbered starting from zero, i.e. the very first indicator in the list has a zero index. The number of indicators in the list can be obtained by callingChartIndicatorsTotal().

mode

[in] Index of the indicator line. Can take values from 0 to 7 and correspond to the index specified when calling the SetIndexBuffer() function.

shift

[in] Index of the value obtained from the indicator buffer (shift relative to the current bar by the specified number of periods back).

Returned value

Numerical value of the specified custom indicator on the corresponding chart.

 
comp:
For the same reason, why compare logically different MAs and RSIs, for example.

MA based on prices or MA from RSI?

If by prices, then of course - through an EA (it is the EA that logically combines these 2 different indicators).
If by RSI, then in one indicator (it will already contain information about both RSI and MA).

Or the meaning of some universal constructor, which could take any indicators attached to the chart and analyze it?
In this case it may be more convenient. But still it is not clear, why do the interactivity in the indicators, if you want to analyze them from the analyzer...

 
Andrey Khatimlianskii:

Or is there some kind of universal constructor that could take any indicators attached to a chart and analyse them?

Then maybe it would be more convenient. But it's still not clear why do the interactivity in the indicators themselves, if you want to study them from the analyzer...

Indicators themselves are objects, interactivity in which is designed according to the logic of their construction. Why should an indicator be static - is not clear.

If we take a completely dumb example, let's take a tick indicator. Suppose that it writes some tick data in the buffer. And it uses only OnCalculate.

While it is hanging in the chart, it has collected some data in its buffers. There's no need to write them to a file (forgot or didn't guess - secondary).

You find the data you see on the chart interesting and want to dump it to a file. How do you do it? - You don't!

You see the data, but can not read them. Unless you parse CTRL+D window via WinAPI. And mind you, no interactivity.

 
comp:

Indicators are themselves objects, the interactivity of which is envisaged by the logic of their construction. Why should an indicator be static - is not clear.

If we take a completely dumb example, let's take a tick indicator.

As for the interactivity, I agree.
But the example is again too farfetched (we forgot/underestimated/we have not thought at all).

Let us agree that for interactive indicators this possibility would be useful.
But in the current realities, we need to implement everything through the EA.

 
Andrey Khatimlianskii:

But the example is again sucked out of your hand (forgetting/neglecting/not thinking at all).

I.e. it's OK when you buy an indicator in the Market, but you can't get its values programmatically. You can only look at it. Insert it into your Expert Advisor - bummer.

 
comp:

I.e. it's OK to buy an indicator from the Market, but you can't get its values programmatically. You can only look at it. Putting it into an EA is a bummer.

you can paste it through iCustom, but the code of the indicator, obtained from the Market, will always be a bummer to paste it into the Expert Advisor
 
Alexander Bereznyak:
you can insert through iCustom
And get in some of the cases that have been extensively dealt with here, not at all what you see on the chart.
 
comp:
And in some cases, that have been extensively discussed here, it's not what you see on the chart.

the indicator re-draws not only the zero bar but also the history, the indicator has not only zero value, but even a negative value, because it cheats - I've seen them, and not just one

and I've seen people fooled by these indicators