Hello, friends,
In a weekend of learning with Grok at the suggestion of xard777 a few posts ago, I decided to embrace this challenge too and start exploring some of the features and see where we can improve or apply concepts and ideas, then I remembered whenever we apply a new version the whole brackground changes color depending on the versions we apply, so it's a good case study.
Starting with version “XU v54-Setup” and going up to the latest available version “XU-20250313” changing the background color every hour.
If you're looking for ready-made versions of templates to apply (this is a wonderfull start to guide you:
post1294817907.html#p1294817907), download them and stop and then check them in the chart properties, and you'll see something like this, and if you prefer can build your own, and the code provided for two situations is open.
And an explanation the difference between RGB and clr
In MQL4 (the programming language used for MetaTrader 4), the difference between RGB and "CLR" relates to how colors are handled, though "CLR" isn’t a standard color model like RGB. Here’s the explanation:
RGB (Red, Green, Blue):
RGB is an additive color model widely used in digital systems, including MQL4, to define colors for graphical elements like charts or indicators. In MQL4, colors are often represented as RGB values using integers. Each component (Red, Green, Blue) ranges from 0 to 255, and the combined value is typically stored as a single integer using the format RGB(r, g, b). For example:
- RGB(255, 0, 0) represents pure red.
- RGB(255, 255, 255) is white.
- RGB(0, 0, 0) is black. This is the standard way to specify colors in MQL4 functions like SetIndexStyle() or ObjectSet() for rendering on charts.
CLR (Likely "Color" or a Misnomer):
In MQL4, "CLR" isn’t an official color model or term defined in the documentation. It’s possible you’re referring to:
- "Color" as a data type: MQL4 uses the color data type to store color values, which are internally RGB-based but can be assigned either via RGB values (e.g., RGB(255, 128, 0)) or predefined color constants (e.g., clrRed, clrBlue). These constants start with "clr" (lowercase), like clrWhite or clrGray, and represent specific RGB values for convenience.
- Misinterpretation: If "CLR" was meant as an abbreviation or typo (e.g., for "Color" or something else), it doesn’t represent a distinct color system in MQL4. Unlike RGB, which is the core method, "clr" is just a naming convention for predefined colors.
Key Difference in MQL4:
- RGB: You explicitly define a color by combining red, green, and blue values (e.g., RGB(0, 255, 0) for green). It gives you full control over custom colors.
- CLR (clr constants): These are shorthand names (e.g., clrGreen, clrYellow) provided by MQL4 for commonly used colors, avoiding the need to specify RGB values manually. Each "clr" constant corresponds to a specific RGB value (e.g., clrGreen is RGB(0, 255, 0)).
Practical Use:
In MQL4 code, you might see:
- ObjectSet("MyLine", OBJPROP_COLOR, RGB(255, 0, 0)); // Custom red line.
- ObjectSet("MyLine", OBJPROP_COLOR, clrRed); // Same result, using a predefined constant. The RGB approach is more flexible for unique colors, while "clr" constants are quicker for standard ones.
In summary, in MQL4, RGB is the underlying system for defining colors numerically, while "CLR" (if referring to clr constants) is a set of named shortcuts for specific RGB values, simplifying coding for common colors.
________________________________________
This assumes "CLR" relates to the clr prefix in MQL4 color constants.
And after you've applied the template, make sure that you don't have this option activated in panel1 (attention this is not apply on the last version, because is not visible this option), but in the last version we have available is on v14m ->
post1295549694.html#p1295549694 and ensure the option "AutoArrangeChart = false"
Suggestion for xard777, for the next version keep this option visible, so that those who use this indicator can have the full experience.
And after loading the indicator above, and if you don't want to wait 1 hour for the next template change, you can use a script to see what the template will look like for each hour.
And in the gif the indicator and script in action.
And get ready for another crazy week
