I still haven't been able to fix this. I really need help.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Basically I have been able to write the code for the candle pattern. The candle pattern is satisfied when the upper wick of 3 consecutive timeframes has the same High and Close for a bullish candle.
The details of the pattern are explained in the attached images.
I am trying to get all the candlesticks that satisfy the condition for the three consecutive timeframes within H6 and M20 and draw a rectangles from the high to the close. The old rectangle regions should persist for 24 hours and the code is updated every 6 hours.
My current issue is several of the zones of various timeframes don’t show on the chart or appear in the log. In several cases the marked rectangle region isn’t correct, which I really don’t understand since from my check the conditions seem to be right.
Here is my code below:
Please help me to fix this.