There's an explanation that an order is executed in the middle of blue or red. At that time, the color was changing, but the next bar HMA indicator covered it up. That's because the HMA repaints the color of previous bar.
You see that orders were executed two bars late. In fact, it's executed at the opening of second bar. To realize a color change, the first bar must complete first; it's because HMA is calculated on Close prices.
Extra_Pips should be set to 0. The HMA of current bar must deviate at least Extra_Pips from the HMA of previous bar. So Extra_Pips = 1 might equal to 5 to 10 points of price.
Ok, everything points to the fact HMA covers up many short-term color changes. But let's observe this, when you see a changing color in the current bar, note the color and time. Look for the bar when you come back a few bars later.
I'll modify the code when this bug is confirmed. Keep the EA running...