Understanding the "Indicator appear" block
-
I want to use that block in my new EA but apparently I don't understand how it works. This is my code so far:
https://fxdreema.com/shared/qAmLLKSCb
And this is what I want it to do:
-
I'm using the "superprofit" indicator. It shows a continuous line that changes from green to red depending on the trend. This means that when the red buffer appears the green one disappears and viceversa.
-
There are two conditions required at a higher time frame before a trade can be opened. They are not relevant in this case.
-
Once both conditions are met new conditions must be met at the current time frame and this is where this block is to be used. What I want is a new change of buffer colour after the higher time frame are met.
Let me put an example. Conditions at the higher time frame indicate uptrend. What I want is that on the current time frame, when the superprofit changes from downtrend (red) to uptrend (green) that condition is then met, but not if the buffer right now is just that. So, if the higher time frame indicates uptrend but the superprofit indicator is green right now at the current time frame, I want it to become red first and then green again for the condition to be met.
It doesn't work right now. I specify at blocks 24 and 25 which buffer I want it to appear, but apparently I'm missing something because no buffer change is detected and condition is considered as permanently met, no matter what the indicator is showing.
Could someone please help me?
-
-
In this block you load a custom indicator and you choose one buffer. I don't care what the indicator is and what is the number of the buffer, this block does the same. It expects the values of the buffer to be EMPTY_VALUE or 0 most of the time, and only from time to time to be something different, lets's say the price value.
The idea is that every buffer has as many values as many candles there are on the chart. If each value is a positive number that can be seen on the chart, then you see something like MA line. But some indicators don't want to draw continuous line, so they use that EMPTY_VALUE value, which is a MQL constant that represents the biggest possible integer value.
"Indicator appear" checks the indicator every time it runs and remembers its last checked values. If the last checked value was EMPTY_VALUE and the current value is say 1.2345, it passes.
I also set it to work with value 0, because some indicators use 0 instead of EMPTY_VALUE.