Compare signals from 3 different indicators which need to be true within 5 bars of the first becoming true
Hi,
I'm trying to compare indicator values from 3 different indicators to generate a signal to place a trade. However I'm not sure to go about it.
What I'm trying to do is to check for:
- Any 1 of the 3 indicators to become true. Store this result
- Once 1 of them has become true, continue checking for at least 1 of the other 2 to become true. Store this result. Check whether the result in point 1 is still true/or some other condition.
- If 2 out of 3 has become true, continue checking for the final indicator to become true. Check whether the result in point 1 and 2 and is still true/or some other condition
- Set some variable to a "buy" or "sell", then execute the trade with some other code. Check whether the result in point 1,2,3 is still true/or some other condition
My code below was what I originally came up with but reading it again for the nth time, it does not look right to me. Racking my brains here. I was thinking to have 3 different if statements for any 1 of the 3 being true and store the result into an array/variable somewhere. Any ideas??
Thanks in advance

Documentation on MQL5: Integration / MetaTrader for Python / order_calc_margin
- www.mql5.com
order_calc_margin - MetaTrader for Python - Integration - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
- any way to store expression into a variable or array?
- Grid stop order management function
- Help needed - chart shows different trades than code

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