NO LINKS, SOURCE CODE REQUESTS OR MODIFICATION OF DECOMPILED INDICATORS. To avoid post deletion please follow the rules.

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 :)
Trade with the broker that supports our work! FBS are offering $140 to get you started! Click, here to begin live trading, today.
No commissions are earned by Forex-station.

Latest: Why was I banned from Forex-station?

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.
Candle Change Code.PNG

Re: Color candles change on cross of indicator MT4

#4
Jimmy wrote:
Wed Aug 12, 2020 2:50 am
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 :)
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.


Attachments 1
  1. Similar Topics

    1. Timeframe Change = Indicator Setting Change?

      2 Replies 671 Views

      by Fabio.g, Sat Jan 25, 2020 12:26 am in Coding Help

      2 Replies
      671 Views
    2. 0 Replies
      1660 Views

Return to “MT4 Indicators”