well, i'm not sure how your indicator works, but i would do this way:
1. create int variables to count red and blue bars
2. when you count blue bars any appearance of red bar changes blue count to 0
3. when you reach blue count=3 then you can set something like bool RedAlert=true, and then after first red bar run alert
i'm sure there are many ways to make it in different way
hope it makes sense
regards
Yeah, it does make sense . Thanks for your help ! :)
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
What would be the best way to code an alert as follow :
After 3 RED bars if a BLUE Bar appears : Alert
After 3 BLUE bars if a RED Bar appears : Alert
Knowing that BLUE bars are "buffer0" and RED bars are "buffer1"
My main difficulty is that the colored bars are not following each other, therefore I have to record the sequence of the last 3, and I`ve got no idea on how to do it ...
Help ?
Ideally the alert would also look at what happened in the last 100 bars and not just record in "real time" .
3lb