Color candles change on cross of indicator MT4

1
Hi

This is probably off-topic, but unsure where else to post. I've started learning MQL4 very recently and am fiddling around with the visual part of the codes for now to suit my preferences.

At the moment, when I use any 2 line indicators, for example, TSI, sometimes both the lines start becoming flat and get very close together, thus making it very difficult to identify when a crossover has happened without checking the data window. Hence I was looking for a code that would change candle colors on the chart based on the crossovers of my 2 line indicators.

Requesting help from you generous people if it isn't too much to ask.


Re: Color candles change on cross of indicator MT4

2
fuseb wrote: Wed Aug 12, 2020 2:34 am Hi

This is probably off-topic, but unsure where else to post. I've started learning MQL4 very recently and am fiddling around with the visual part of the codes for now to suit my preferences.

At the moment, when I use any 2 line indicators, for example, TSI, sometimes both the lines start becoming flat and get very close together, thus making it very difficult to identify when a crossover has happened without checking the data window. Hence I was looking for a code that would change candle colors on the chart based on the crossovers of my 2 line indicators.

Requesting help from you generous people if it isn't too much to ask.
Interesting post, moved to it's own thread. I'm sure one of the guys here will help.

Can you post your 2 line indicators that "cross"? So we have a better understanding? Also a screenshot with the conditions outlined would be good.

Welcome to the site :)
These users thanked the author Jimmy for the post:
fuseb
Guide to the "All Averages" Filters (ADXvma, Laguerre etc.) 🆕
Use Fibonacci numbers for indicator settings + How to draw Fibonacci Extensions
An easy trick for drawing Support & Resistance

Re: Color candles change on cross of indicator MT4

3
Thank you so much Jimmy. You make life browsing this forum so much easier. I especially appreciate the fact that you rename the screenshots of the indicators that you post links of, thus saving me the hassle of doing it myself as I download plenty of indicators and screenshots at a time.

Coming back to topic, I have attached a screenshot of a chart with three 2 line indicators (ASH, Ergodic TSI and RVI) where signals are derived based on which line crosses over the other. If you check the bottom pane consisting of RVI, I have marked two areas in white ellipses where both the lines are nearly flat and have crossed each other multiple times. During live trading when I am scanning each pair at around the close of the candle, it becomes very difficult in the white marked scenarios to tell if a crossover is really happening without checking the values in the data window. Same challenge arises when I am backtesting such indicators.

That is why I am looking for a code that would cause the candles to change to, for example, green when the indicator green line crosses above the red line and to red when the indicator red line crosses above the green line.
Attachments

Re: Color candles change on cross of indicator MT4

4
Jimmy wrote: Wed Aug 12, 2020 2:50 am

Interesting post, moved to it's own thread. I'm sure one of the guys here will help.

Can you post your 2 line indicators that "cross"? So we have a better understanding? Also a screenshot with the conditions outlined would be good.

Welcome to the site :)
Sometimes I also drag an MA onto a single line indicator to make it a two line indicator and treat the crossovers as signals. Forgot to add that to the screenshot above, but you get the idea. Whatever the case, I wanna be able to modify the indicator code to cause changes in candle color based on crossover of the indicator lines.


Who is online

Users browsing this forum: ChatGPT [Bot], Grapeshot [Bot], Intrest 1, Jimmy, Ruby [Bot], thomdel and 100 guests