RSI and Envelopes on same chart

 

I have this chart on Boom 1000. The goal is to have the RSI and the Envelopes on the same indicator window. Once I drag the Envelopes on the RSI chart I get this popup asking to choose the Apply to.

So now what Im trying to figure out is how to code the exact same thing using MQL5 but still apply the Envelope to the close and still have them appear on the same RSI window as shown below

Anytime I code this Envelope using the Price close as the handle it appears on the main chart not on the RSI chart. 

Envelopes - Trend Indicators - Technical Indicators - Price Charts, Technical and Fundamental Analysis - MetaTrader 5 Help
  • www.metatrader5.com
Envelopes Technical Indicator is formed with two Moving Averages , one of which is shifted upward and another one is shifted downward. The...
Files:
mql5.jpeg  140 kb
 

I am Also coding the same 2 indicator in 1 window and i have completed the 80% of the code, once i will get it done  will update you.

 

instead of using PRICE_CLOSE, type in the handle of the iEnvelopes indicator

rsi_handle = iRSI(NULL, 0, rsiPeriod, envelopes_handle);

unfortunately this approach ends up being lower quality than if you code the Envelopes mathematically and then code a OnBuffer mechanism, same holds true if you're doing MaofRSI