STEP12 How to get the lowest candle

ARE YOU STILL BROKER FOOD?
EASY AUTOMATED TRADING! 
PRECODED MODULES AND STRATEGIES!
FASTER, BETTER, AUTOMATED RESULTS YOU WILL GET NOWHERE ELSE
CLICK HERE  TO START  NOW

The lowest candle can be useful for technical Expert Advisors

If you have ever read a book about technical chart analysis, you might know that it is all about new highs and new lows. To calculate the lowest candle within the last x candles, you can use this simple code (simply paste into new and empty EA template)

double LowestCandleM1;
void OnTick()
 {
LowestCandleM1= CheckForLowestCandle();
Comment ("Number of the lowest candle within the last 10 candles before the current candle: "+ LowestCandleM1);
 }
double CheckForLowestCandle()
{
double Low[];
ArraySetAsSeries(Low,true);
CopyLow(_Symbol,PERIOD_M1,0,11,Low);
double Calc1= ArrayMinimum(Low,0,11);
return Calc1;
}

Here is how it looks like

CheckForLowestCandle

If you want to use it within you own EA, simply copy and paste the CheckForLowestCandle() function and add the two lines in the OnTick function into the appropriate place in your own code.

Would you like to know the lowest candle within the last 100 candles instead? Simply change the number 11 in the two lines above the line

return Calc1;

to 101.

Learn how to create your own MQL5 trading robot for $1
Sign Up Now