Download MetaTrader 5

Indicators: Heat Map

To add comments, please log in or register
Find out how to install MetaTrader on Linux
MetaQuotes Software Corp.
Moderator
181076
MetaQuotes Software Corp. 2010.07.21 07:30 

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 2010.07.24 08:57  
just what I need
MQL4 Comments
16319
MQL4 Comments 2010.07.27 14:19  
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 2010.08.02 00:40  

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 2010.08.02 00:40  
Btw: http://www.thetradingtheory.com/colors-in-mql4/
Haroun Boutamani
167
Haroun Boutamani 2010.08.02 12:35  
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
167
Haroun Boutamani 2010.08.05 15:27  

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