Hi there,
I've been struggling with this for quite a while and just couldn't get my head around what's going on here. I'm building an EA which is using the CCI indicator. When a BUY trade is opened, my EA should continuously monitor the values of the CCI: when CCI falls below a specified constant, the trade should be closed.
Let's suppose these constants are 75, 50, and 25. This means the EA would close the BUY trade the very moment CCI falls below 75, 50, or 25 the first time. If the upward trend is strong, CCI will rush up to approximately 100 and as the bullish momentum is fading away, CCI will reach 75 from above, thus activating the exit condition. In the case of a somewhat weaker bullish trend, CCI might rebound around 65 and reaching 50 from above, thus activating the second exit condition. The third exit condition (for CCI=25) is analogous.
As you can see in the attached image, my idea was setting up an If Trade condition on top which is set to only detect if the trade is a BUY order, and then having the three conditions in parallel, i.e. as OR conditions. However, to my surprise, this didn't work out as I expected. Instead, only the rightmost (third) condition was activated to close the trades every time. Thus the EA doesn't seem to detect CCI passing through +75 from above and CCI passing through +50 from above.
I included the settings of each of my blocks too to give you a better understanding of what I'm facing.
Have you encountered this before? Am I wrong in my logic somewhere? Is there any other way you would solve this?
Thank you so much for your help!
