You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi everyone,
As algorithmic trading evolves, so do the expectations for Expert Advisor (EA) interfaces. Many of us have transitioned our core logic from MQL4 to MQL5, yet a significant number of EAs still rely on standard objects ( OBJ_BUTTON , OBJ_RECTANGLE , OBJ_LABEL ). While functional, these often result in clunky interfaces with outdated 2.5D/3D styling and inconsistent scaling.
Recently, I’ve been exploring the CCanvas class to completely bypass standard objects and render pixel-perfect, custom UIs directly on the chart. I want to open a discussion on the architectural and design choices involved in building professional dashboards.
Here are a few design principles and technical aspects I’ve been focusing on:
Embracing Clean, 2D Aesthetics: Moving away from default gradients and faux-3D borders. A modern UI often looks best with a strict, flat 2D design—think crisp, solid borders and bright, clean white backgrounds that make data pop.
Absolute Typographical & Color Control: Standard objects limit styling. With Canvas and anti-aliasing, we can utilize specific, strong fonts (like the Segoe UI family, especially heavier weights for headers) to ensure maximum legibility. It also allows us to enforce exact HEX color branding (for example, utilizing a deep corporate blue like #0b50a2 consistently across all borders and primary elements) without the terminal altering the shade.
Interactive Fluidity: Handling CHARTEVENT_MOUSE_MOVE and CHARTEVENT_CLICK to create responsive hover states and smooth transitions, making the EA feel like a standalone software rather than a simple script.
Questions for the community:
To make this a collaborative discussion, I'd love to hear how other developers are tackling Canvas-based UIs:
Performance Optimization: When designing complex 2D dashboards with multiple layers (backgrounds, text, interactive buttons), how do you manage the redraw cycles? Do you redraw the entire Canvas on every tick, or do you implement state-management to only update specific regions (partial redraws) to prevent terminal lag?
High-DPI & Scaling: Custom typography (like Segoe UI) and precise pixel positioning can look great on a standard 1080p monitor but break on a 4K screen. How do you handle dynamic scaling and font sizing within CCanvas for high-DPI displays?
Event Handling Architecture: Do you write your own custom event-handling frameworks from scratch to track mouse coordinates over your drawn "buttons", or do you rely on specific open-source MQL5 libraries to speed up the process?
Looking forward to hearing your insights, seeing code snippets, or checking out screenshots of the custom UIs you’ve built!