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

 

I can imagine a lot of variants of what exactly you need. you need clarifications. a lot of clarifications.

you have an indicator, which buffer contains Close prices of bars.

you want to call another indicator from this indicator (e.g. MA) and feed the Close buffer to it.

question -

- at what stage of Close calculation do you plan to do this?

- where do you plan to get the result of that second indicator?

 
paul.necsoiu:

Hi,

This is a very good article but I have some questions. 

1.  Only the indicators that uses the short form of the OnCalculate() function call, can be applaied to another indicator or the indicators that use the long form of the OnCalculate() function call can be applied too? If so , haw can be applied one indicator with long form of the OnCalculate() function call, to another indicator???

2. Applying one indicator to another (TSI over RSI) generates some display problems (see attached image). While RSI is plotted from 0 to 100 the second indicator (TSI) have values below 0 too , values wich are not visibile on the chart. Wich is the problem and why the chart don't properly adjust to display correctly both indicators. Can we solve this problem or it's a MetaTrader bug???

1. Yes only indicator that uses the short form of OnCalculate can be applied to another indicator data.

2. You have to edit to properties of RSI indicator and change "Fixed minimum" on the Scale tab to -50 instead of 0.

 
Attached source code files and source code insets in HTML code are now completely translated into Portuguese for your convenience.
MQL5.community - User Memo
MQL5.community - User Memo
  • 2010.02.25
  • MetaQuotes Software Corp.
  • www.mql5.com
You have just registered and most likely you have questions such as, "How do I insert a picture to my a message?" "How do I format my MQL5 source code?" "Where are my personal messages kept?" You may have many other questions. In this article, we have prepared some hands-on tips that will help you get accustomed in MQL5.community and take full advantage of its available features.
 
I am somewhat a newbie in mql programming...my question is how do i make an indicator that checks the upper bollinger band value at a specific bar,whether at that point the bollinger band value is between the open and close of that bar after which it plots a down arrow above the current bar.. if close[1]>upperbollingvalue[1]>open[1] .. I have tried searchng around but no luck..
 
So I decided to master the ways of building an indicator from an indicator and faced some problems, the solution of which I did not find even in this article. The problems have already been voiced


Vladislav Eremeev:
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 buffer of the Ongoing indicator.
Further.
It is possible to pass the OTHER indicator handle, but I have not found where to specify which buffer should be used.


o_O:

I can imagine a lot of variants of what you need. you need clarifications. a lot of clarifications.

you have an indicator, which buffer contains Close prices of bars.

you want to call another indicator from this indicator (e.g. MA) and feed the Close buffer to it.

question -

- at what stage of Close calculation do you plan to do this?

- where do you plan to get the result of that second indicator?

A lot of clarifications:

To make my explanation more clear, let's turn to the writing of MACD indicator under the condition that it is not in MT5 delivery.... But there is iMA with the possibility to pass the indicator handle as a price constant. But here is the problem, for this we need to write an indicator of the difference of MA values and separately to it, having received the handle, to make a signal line. But there is no possibility to use iMAOnArray() inside, as in mql4.

More clarifications:

According to some formula, we got the values of the indicator buffer 0. Then we need to calculate the average of these values. There are no other options to calculate by your own formula? In the MovingAverages.mqh inclusion the same formulas. This is not the option I would like to find out.


Others have a lot of clarifications:

We have a custom indicator with two or three buffers. The task is to calculate the average of buffers 1 and 2 separately. Having received the handle of such an indicator, it is possible to get the values of these buffers by means of CopyBuffer(), but there is no possibility to send them to iMA. What should I do?


If you don't mind... The question is not to get the result, but to understand how to use the possibility to transfer the handle of another indicator to some technical indicators and what you can and cannot get.

 

Alexey Viktorov:

We have a custom indicator with two or three buffers. The task is to calculate the average of buffers 1 and 2 separately. Having received the handle of such an indicator, it is possible to get the values of these buffers using CopyBuffer(), but there is no possibility to send them to iMA. What to do?

To make a wrapper around this indicator, which copies a certain buffer, under the number specified by an additional parameter in the properties.

And it is its handle that should be transmitted.

 
Комбинатор:

Make a wrapper around this indicator, which copies a certain buffer, under the number specified by an additional parameter in the properties.

And that's exactly its handle and pass it.

Can you please elaborate?

As I understood, on the basis of this copied buffer make an indicator, and then, having received its handle, you can use the received data in the next indicator. Or is it not so?
 
Alexey Viktorov:
As I understood, to make an indicator on the basis of this copied buffer, and then, having received its handle, you can use the obtained data in the next indicator.
Yes, sort of.
 
Комбинатор:
Yes, sort of.
Compared to iMAOnArray() from mql4, it's a tambourine dance.



And here's such a crazy idea: If an indicator is attached as a resource, is it possible to get its handle? Can't it be crossed. In order not to carry two indicators, the indicator itself and the indicator from this indicator. I haven't practised resources, so it's hard for me to check, so I'm asking.
 
Alexey Viktorov:
Compared to iMAOnArray() from mql4, it's a tambourine dance.



And here is such a crazy idea: If an indicator is attached as a resource, is it possible to get its handle? Can't it be crossed. In order not to carry two indicators, the indicator itself and the indicator from this indicator. I haven't practised resources, so it's hard for me to check, so I'm asking.

I think it's a real tambourine dance, in the current implementation :)