DRAW_COLOR_ZIGZAG - MetaTrader 5 Script | Forex Indicator Download - MT4/MT5 Resources

An example of an indicator that draws a saw through high and low prices, using the DRAW_COLOR_ZIGZAG painterly style.
The color, thickness, and style of the jagged lines change randomly every N ticks. Note that 8 colors are initially set for plot1 graph drawing (using the DRAW_COLOR_ZIGZAG style), using the #property compiler directive. Then, the color in the OnCalculate() function is randomly selected from the 14 colors stored in the colors[] array.
The N parameter of the indicator is set as an external parameter so that you can adjust it manually (Input tab properties dialog of the indicator).
See the article Drawing styles in MQL5 .

Attachment download
📎 draw_color_zigzag.mq5 (7.05 KB)
Source: MQL5 #347
DRAW_COLOR_ZIGZAG - Important points before using MetaTrader 5 script
This page has been supplemented with structured instructions, focusing on the purpose of trading scripts, MT4/MT5 platform compatibility, testing procedures and risk control. Before downloading or deploying, it is recommended to first determine whether it is consistent with your own variety, cycle and account environment.
Suitable for who to use
- Users who want to quickly screen trading scripts and are willing to do simulation verification first.
- People who need to compare MT4/MT5 EAs, indicators, scripts or source code projects.
- Traders who wish to record backtests, parameters and risk boundaries before placing a trade.
Testing and risk control suggestions
- First verify the default parameters in the strategy tester or demo account, and then adjust the symbol, period, spread and trading period one by one.
- Scalping, grid, martin, and high-frequency strategies should focus on observing maximum drawdowns, consecutive losses, slippage, and trading frequency.
- It is not recommended to run any document directly on the real disk. At least observe the simulated disk performance for 2-4 weeks first.
FAQ
Can MT4 and MT5 be used interchangeably?
Usually cannot be used directly. EX4/MQ4 corresponds to MT4, EX5/MQ5 corresponds to MT5, and the source code needs to be compiled in the corresponding MetaEditor.
Is this resource guaranteed to be profitable?
cannot. EAs, indicators and scripts can only be used as trading tools, and the results depend on parameters, market environment, spreads, slippage and risk control.
What else can I continue to watch?
Forex EA download , foreign exchange indicator download , EA evaluation , MQL5 CodeBase .
English Search Notes
This page is also optimized for English search intent around DRAW_COLOR_ZIGZAG - MetaTrader 5 script . Related search terms include: trading script, MT4 script, MT5 script. Test any Forex EA, Expert Advisor, MT4/MT5 indicator, script or MQL source code with historical data and a demo account before live trading.
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •