Barebone Gradient Candles - MetaTrader 5 Script | Trading Script Download - MT4/MT5 Resources


Colorful candlesticks illustrate gradient. It's a bit difficult to find a good working example of DRAW_COLOR_CANDLES that you can understand, most of the comments are useless, and the documentation doesn't even specify a drawing limit (PLOT_COLOR_INDEXES length is limited to 64, [0; 63]) or the order in which the functions should be called.
I'm also having trouble finding a working algorithm for moving an X color to a Y color (I believe this is called a gradient?); this code contains a math function that returns the gradient from X to Y, and I'd be interested to know if anyone has a better way to do this.
Please feel free to suggest patches in the comments, this code is a work in progress and free to everyone - you can also remove the permission attribute if you wish, but the // author: comment list should be maintained.
v1.01 - fix order, was reversed (missing 1.0 - percentage calculation)
Attachment download
📎 barebone_gradient_candles.mq5 (8.24 KB)
Source: MQL5 #35362
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •