Pine indicator showing signal from several timeframes on the currently open timeframe

Job ID: 34117425

Budget: $30 – $250 USD

I have a simple Pine script Indicator that colors Bullish, Bearish and Neutral areas on the chart depending on the interposition of 3 EMAs and current low/high value of the bar:
long = ema1>ema2 and ema2>ema3 and low>ema3
short = ema1<ema2 and ema2<ema3 and high<ema3

I want this to be redone. I need to see this signal for multiple timeframes (M1, M5, M15, H1, etc. - can be limited from 1 to all available timeframes by the user) as a squares/rectangles colored in green/yellow/red in the right upper corner of the chart. Alerts to be copied to other timeframes as well. So it does not matter which timeframe I am currently at, chart is colored for this timeframe and shows colors for other timeframe for this instrument as well.

Please see original code attached
Related categories: Pine Script