Indicator trade signals across multiple bars

 

I have multiple criteria for a trade signal that can occur with in a certain number of bars from each other. For example, on the hourly time frame, the stocastics show over bought at 1pm and I want to allow 3 more hourly bars to produce the second criteria (say a moving cross over at 4pm) before the stocastic signal is no longer valid. How do I code this? I was thinking of using an array but I am not sure if that would be best. Any code samples would be very helpful as I am new to MQL4. Thank you.

 

Here's the macd sample converted into a simple stochastic sample that buys when it breaks oversold(30) level sells overbought(70) level etc.

Maybe it'll help.

Cheers.

Files:
Reason: