Apply the moving average and RSI on a custom indicator

 
hello,
I want to apply moving average or RSI on a second data/line of a custom indicator. My indicator draws two lines.
There is no difference between choosing first indicator's data and previous indicator's data. on both options the moving average is calculated for the first line.

 

It's hard to understand the situation, can you please provide a screenshot image?

Note that a moving average is following the chart of candles, an RSI is an oscillator ranging from 0 to 100. You can't code both in the same indicator unless you use a special window scaling formula on the moving average. The buffer values of a moving average are extremely different and not within a range.

You can however drag both indicators into the same subwindow, and the software will automatically scale the moving average in a strange way. But it is visual only, and it is not relating with the RSI in any way.


In regard to scaling a moving average in code to within a range of 0 to 100 like you see in the window -  I have absolutely no idea. 
 
milad:
hello,
I want to apply moving average or RSI on a second data/line of a custom indicator. My indicator draws two lines.
There is no difference between choosing first indicator's data and previous indicator's data. on both options the moving average is calculated for the first line.

When "connecting" an indicator to the data buffer of another indicator, it will only read the first buffer of that source indicator. You cannot change that.


 
Dominik Egert #:
When "connecting" an indicator to the data buffer of another indicator, it will only read the first buffer of that source indicator. You cannot change that.


Thank you for the clarification, Dominik.
I hope that the MT5 developers consider adding a feature in future releases that allows us to apply indicators to specific data buffers, so we can have more flexibility with custom indicators.

 
Dominik Egert #:
When "connecting" an indicator to the data buffer of another indicator, it will only read the first buffer of that source indicator. You cannot change that.


How do you mean by this? Can't you read as many buffers as you want from another indicator? 

you simply change this number to the designated buffer number in the custom indicator

 
milad #:

Thank you for the clarification, Dominik.
I hope that the MT5 developers consider adding a feature in future releases that allows us to apply indicators to specific data buffers, so we can have more flexibility with custom indicators.

It's already there...what you were trying to do is make an oscillator plot (a plot range limited from a min to a max) with an MA plot (a plot that has no upper or lower limit!). You're also creating confusion for not providing code for the issue you face. What you think is a limitation is most likely not a limitation at all

 
Conor Mcnamara #:

How do you mean by this? Can't you read as many buffers as you want from another indicator? 

you simply change this number to the designated buffer number in the custom indicator

OP asked about applying MA/RSI on another indicator (without programming), which is indeed limited in MT5 to 1-st buffer only. The feature request to select a buffer index of source indicator has been filed many times, but there is no MQ reaction still.

Programming via CopyBuffer is possible, of course, but not a ready-made solution.

The only thing OP could do, if he is the author of the source indicator and has its codes, replace the 1-st and 2-nd buffers with each other.

 
Stanislav Korotky #:

OP asked about applying MA/RSI on another indicator (without programming), which is indeed limited in MT5 to 1-st buffer only. The feature request to select a buffer index of source indicator has been filed many times, but there is no MQ reaction still.

Programming via CopyBuffer is possible, of course, but not a ready-made solution.

The only thing OP could do, if he is the author of the source indicator and has its codes, replace the 1-st and 2-nd buffers with each other.

You're right. My question is about applying indicators to custom indicators from the UI(without programming).That is fast and easier because it doesn't require modifying the original code.
 
Stanislav Korotky #:

OP asked about applying MA/RSI on another indicator (without programming), which is indeed limited in MT5 to 1-st buffer only. The feature request to select a buffer index of source indicator has been filed many times, but there is no MQ reaction still.

Programming via CopyBuffer is possible, of course, but not a ready-made solution.

The only thing OP could do, if he is the author of the source indicator and has its codes, replace the 1-st and 2-nd buffers with each other.

I didn't see anywhere where it was specified in the original post "without programming", so I'm not sure how or why you surmised that, but ok then

 

Maybe you could try an intermediate indicator. The intermediate indicator will only have one buffer, which copies target indicator's second buffer. Then you can pass the handle of the intermediate indicator as source to other indicators. I'm not sure if this works, but something to consider. 

 
Conor Mcnamara #:

I didn't see anywhere where it was specified in the original post "without programming", so I'm not sure how or why you surmised that, but ok then. A simple icustom script could also be made to input buffer numbers, and also input the path names of indicators.

In the first post I mentioned `first indicator's data and previous indicator's data`. Both of them are in MT5 UI.