TheGeek:
Hello,
I have an array of 200 candlesticks for EUR/USD 1hr chart. How can I detect breaches using mql5? Please help.
Breaches of what?
Keith Watford:
I guess he meant a breakout ?
Breaches of what?
You can query the highest/lowest price of a series of candles and then check if the actual price surpasses it.
int lookback=20; // 20 candles int start=1; // starting from the last one int shift=iHighest(_Symbol,_Period,MODE_HIGH,lookback,start); double localHigh=iHigh(_Symbol,_Period,shift); if(Bid>localHigh) { // breakout } shift=iLowest(_Symbol,_Period,MODE_LOW,lookback,start); double localLow=iLow(_Symbol,_Period,shift); if(Bid<localLow) { // breakout }
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,
I have an array of 200 candlesticks for EUR/USD 1hr chart. How can I detect breaches using mql5? Please help.