does anyone know how I can get the chart background color in mq4?
I want to able to automatically decide on the color to use for a symbol in an indicator.
e.g. If the chart is white, the use a black symbol, but if the chart is black, use a white symbol.
code from similar discussion 'Как определить цвет фона у терминала?'
int GetDC(int hwnd);
int ReleaseDC(int hwnd,int hdc);
color GetPixel(int hdc,int x,int y);
Print("Цвет фона "+back_ground);
This is excellent, however I have to comment on some minor, though possible problems some may
encounter with using WindowHandle() for locating the chart's background color.
If the Symbol and TimeFrame (upper left hand corner) are not visible, the background color will return
a -1 value. If one were to reposition their chart just slightly to the left, where the Symbol and TimeFrame
display are hidden from view, you will see this take place. It makes me curious how exactly WindowHandle
works or renders, since the chart's symbol and timeframe must be 100% visible.
However, I don't think there is a better method available then what you have freely shared, so I am
not complaining and I do thank you.
To add comments, please log in or register