I would like to create a Metatrader indicator that when dragged on the chart, it will DETECT ALL RECTANGLES on the timeframe we are and extend the rectangle in time 5 candles more automatically, the starting point of the rectangle will be always kept and be the same.
--- I am on 4H chart, the rectangle will always be 5 candles more, 5 times 4H. If a 4H candle closes then the rectangle will extend 1 more candle to match 5 candles more. Same for D1, if D1 closes, then the indicator will extend all rectangles on the D1 timeframe 1 more candle to match 5 candles
--- If I am on D1 chart and then I switch to 4H chart, then it will detect all rectangles and do the same calculation
** The indicator will automatically be extending the rectangles EXCEPT those rectangles that have a name starting with: aII_SupDem
The number of candles to extend the rectangle should be configurable under indicator Inputs tab
These settings should be configurable on the script. It will ONLY affect the timeframe where I drag the script on.