Download MetaTrader 5

Indicators: Heat Map

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
188146
MetaQuotes Software Corp.  

Heat Map:

The purpose of this indicator is to highlight the price zones that had the most activity : the hotest zones.

Author: mt-coder

NEKSUS
1084
NEKSUS  
just what I need
MQL4 Comments
16319
MQL4 Comments  
The indicator is cool but it would go a long way if someone can develop different color patterns for the varying degrees of activities.
Julien
33
Julien  

Your indicator is nice, but your code is seriously bad and hard to read. You have no structure.

If you share your code, you should try to write it in a better, easier way to read and understand.


It would be great to have a gradient color from green to reg to read the result more easily.

Here are two functions that would be useful for you:

int rgb2int(int r, int g, int b) {
return (b*65536+g*256+r);
}
int colorgradient(int r, int g, int b, int r2, int g2, int b2, double min, double max, double pos) {
double steps = (max-min);
pos = max-pos;
double stepR = (r-r2)/(steps-1);
double stepG = (g-g2)/(steps-1);
double stepB = (b-b2)/(steps-1);
return (rgb2int((r-(stepR*pos)),(g-(stepG*pos)),(b-(stepB*pos))));

}


rgb2int does what you would expect, no explanation needed.

colorgradient returns a color on a gradient scale. Here is how to use it:

Imagine you have a value oscillating between 0 and 100; You want each value to be color coded in a gradient going from green (value = 0) to red (value = 100).

int min = 0;
int max = 100;
int value = 70; // let say you want to get the color corresponding to value 70
color c = colorgradient(255,0,0, 0,255,0, min,max,value); // 255,0,0 -> red / 0,255,0 -> green
Julien
33
Julien  
Btw: http://www.thetradingtheory.com/colors-in-mql4/
Haroun Boutamani
173
Haroun Boutamani  
zenhop:

Your indicator is nice, but your code is seriously bad and hard to read. You have no structure.

If you share your code, you should try to write it in a better, easier way to read and understand.

I made it as simple as I could, sorry if it wasn't simple enough for you to read...

I will consider that function when I'll have time, thanks.

MT-Coder

Haroun Boutamani
173
Haroun Boutamani  

The multicolor version is ready, it should appear shortly https://www.mql5.com/en/users/mt-coder/publications .

Thanks for comments

To add comments, please log in or register