Discussion of article "Applying One Indicator to Another" - page 2

 

Maybe I'm misunderstanding the question, but I'll try to throw in another idea

indicator_applied_price

int

sets the default value for the "Apply to" field. You can set one of the values of the ENUM_APPLIED_PRICE enumeration. If the property is not set, the default value PRICE_CLOSE is applied

 
Rosh:

Maybe I'm misunderstanding the question, but I'll try to throw in another idea

indicator_applied_price

int

sets the default value for the "Apply to" field. You can set one of the values of the ENUM_APPLIED_PRICE enumeration. If the property is not set, the default value is PRICE_CLOSE

The idea is good, but it's a bit sideways (like jumping in width:).

It is necessary to transfer the value of the applied_price parameter that the user selected in the external indicator to the internal one.

For example, there is an MA that is built on the selected data (this is an internal indicator), and the value of this MA should be subtracted from the price.

Accordingly, if PRICE_CLOSE is selected, the MA should be built on the basis of this price and the same price should be used in the indicator calculation formula.

1 инд
МА(app_price)
2 инд
МА(app_price)-price(app_price)
 

From the above we can see that app_price is simply asked to be declared as input, but then the user will have to specify the required parameter twice.

Once in Inputs and once in Parametrs. That is not good.

There may be cases when it is necessary, but there are cases when it is bad.

 
I think it's not fatal. How often does this problem occur in everyday life? Once can be specified at startup.
 

I support user Urain. How to find out what is contained in the array price[] ? What price is it exactly?

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

If it is impossible to find out, then the point of using the price[] array is also lost.

This problem arises every time when programming a multicurrency indicator. For example, we want to create an indicator of correlation between currencies. We already have an array with prices. This is price[]. We load the prices of the second instrument. But of what type?

We will have to bring the app_price parameter into the input and load two arrays with prices independently, bypassing price[].

Not convenient!

Построение мультивалютного индикатора с применением множества промежуточных индикаторных буферов
Построение мультивалютного индикатора с применением множества промежуточных индикаторных буферов
  • 2010.05.17
  • Alexey Klenov
  • www.mql5.com
В последнее время возрос интерес к кластерному анализу рынка FOREX. MQL5 открывает новые возможности исследования закономерностей движения валютных пар. Важным преимуществом MQL5, по сравнению с MQL4, является возможность использования неограниченного количества индикаторных буферов. В данной статье описан пример построения мультивалютного индикатора.
 
EvgeTrofi:

I support user Urain. How to find out what is contained in the array price[] ? What exactly is the price?

And what is the logic in it? We are not fitting, we are just calculating on the array of prices.

But if you need to calculate on a specific price, then use OnCalculate call in the first form with app_price explicitly outside.

Документация по MQL5: Основы языка / Функции / Функции обработки событий
Документация по MQL5: Основы языка / Функции / Функции обработки событий
  • www.mql5.com
Основы языка / Функции / Функции обработки событий - Документация по MQL5
 
sergeev:

Why is it logical? We are not fitting, we are just calculating on an array of prices.

But if you need to calculate on a specific price, then use OnCalculate call in the first form with app_price explicitly outside.


Alex, look at the title of the topic...

you call an indicator from an indicator, which in turn calls another indicator, all indicators are built on OnCalculate according to the scheme with "price",

how to pass to the lower indicators when calling which app_price is required.

It is not economical to carry the whole set of prices for each indicator if the user has clearly defined one. But if you choose the OnCalculate overload with the full set, it will be so.

If you apply a reduced version of OnCalculate and at the same time put app_price in the inputs, you will get confusion, then the user will be able to make a mistake by specifying one app_price in the inputs and another in the parameters.

 

What is missing is the possibility to call an external indicator using the buffer of the current indicator.

For example, let's assume that there is no stochastic in the delivery.

I calculated the %K line and put it into the buffer.

Next I need to calculate the %D line.

And this is where I would call an external wizard.

I would be told to calculate it myself using the %K buffer.

But what do I do:

1. if I don't know the code of this wizard and I bought this wizard as a compiled indicator.

2. inbuilt indicators are counted much faster than their MQL counterparts.

It would also be very useful to be able to call indicators on the input buffer.

Maybe all this is already available? Then please give me a link to the documentation.
.

Способы вызова индикаторов в MQL5
Способы вызова индикаторов в MQL5
  • 2010.03.09
  • KlimMalgin
  • www.mql5.com
C появлением новой версии языка MQL, не только изменился подход к работе с индикаторами, но и появились новые способы создания индикаторов. Кроме того, появилась дополнительная гибкость при работе с индикаторными буферами - теперь вы можете самостоятельно указать нужное направление индексации и получать ровно столько значений индикатора, сколько вам требуется. В этой статье рассмотрены базовые методы вызова индикаторов и получения данных из индикаторных буферов.
 
VladMsk:

What is missing is the possibility to call an external indicator using the buffer of the current indicator.

For example, let's assume that there is no stochastic in the delivery.

I calculated the %K line and put it into the buffer.

Next I need to calculate the %D line.

And that's where I would call the external wizard.


Do you need that external wizard to fulfil this possibility from the documentation?


 
sergeev:


do you need that the external mask corresponds to this possibility from the documentation?


Alexey,
Thank you for your time.
According to the documentation it is necessary to pass the OTHER indicator handle,
and I spoke out for the possibility to process the current indicator buffer.
Further.
The OTHER indicator handle can be passed, but where to specify which of the buffers should be used I did not find.