Download MetaTrader 5

MQL4 EA based on PIVOT POINTS a little problem with too much options.

To add comments, please log in or register

Hello guys,

i am programming EA which has entry based on pivot points.

For example condition that top wing of bullish candle touches pivots R1 or R2 or R3. ( i have already programed all highs lows etc. or values for pivot points that not my problem.)

      (   ((high1>=R1_1 && close1<=R1_1) ||    (high1>=R2_1 && close1<=R2_1) ||  (high1>=R3_1 && close1<=R3_1))  

My problem is that i need to programm condition for all possible touches back to 3 days pivot points to trigger a trade ( always touches at top wing).

Next example: R1_day1 touches and R2_day2 touches. Etc.

I know how i can write this by using OR OR OR OR (first example for every possible options), but there is too many possible options that i would must write.

So i ask about some easier way how to do it because if you think about it is really too much possible conditions with three days back it is 3+3+3+1+3+3+3 lines (values).

To add comments, please log in or register