Hello,
I assume the logic is fine because after a little trick it works but it should works well from the beggining.
I have this indicator based on CCI signals(CCI line cross under 100 for sell and over -100 for buy), it is filtered by MA moving average (price over MA for buy and under MA for sell) and finally it is filtered by PIVOT(price over P line for buy and under P line for sell).
Indicator has to show an arrow when 3 assessments are true, BUT there is a bug in m5 chart, sell signals does not appear until I scroll back in history and find the first down arrow, here is a short video about https://youtu.be/SJ6x_F_wz3E
Without Scroll
After Scroll
Indicator code