# Indicators: Heat Map

Moderator
188146

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

Author: mt-coder

1084

just what I need
16319

The indicator is cool but it would go a long way if someone can develop different color patterns for the varying degrees of activities.
33

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
```
33

173

zenhop:

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

173

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