Thank you for the advice that helped me a lot, @jstap. I also have some additional recommendations for those who encounter the same issues as I did or are interested:
When I used this code approach to create an MQL5 EA that uses Zigzag, I encountered the error: "Error: Cannot get value from a custom indicator. (handle=15 | error code=4806)" during backtesting/optimization, which caused the backtest/optimization to slow down.
Upon investigating the cause of this error, I found that it occurred because the Zigzag high/low at sequence 0 could not be found simultaneously. Specifically, if there is a high of 0, the low of 0 will also be missing, and vice versa. Therefore, for every Zigzag from FXdreema, when using high 0 and low 0, add an "indicator is visible" block to check if the value appears correctly before calling the Zigzag high 0/low 0 value.
Note: Other Zigzag IDs, i.e., those greater than 1, do not have this problem because the values are definitely present.
As shown in this example: https://fxdreema.com/shared/dMTrCKjG