Liquidity_Predator/Utilities/M_CheckWigsLastCandles.mqh

23 righe
Nessun fine linea
773 B
MQL5

bool M_CheckWigsLastCandles(E_DIRECTION eDir, int nNumberOfCandles)
{
for(int i = 1; i <= nNumberOfCandles; i++)
{
double candleSize = stGVL.Candle[i].high - stGVL.Candle[i].low;
if(candleSize == 0)
continue;
double upperWick = stGVL.Candle[i].high - MathMax(stGVL.Candle[i].open, stGVL.Candle[i].close);
double lowerWick = MathMin(stGVL.Candle[i].open, stGVL.Candle[i].close) - stGVL.Candle[i].low;
double upperPercent = (upperWick / candleSize) * 100.0;
double lowerPercent = (lowerWick / candleSize) * 100.0;
if(eDir == DIR_LONG && upperPercent > nMinWigSizePercent)
return true;
if(eDir == DIR_SHORT && lowerPercent > nMinWigSizePercent)
return true;
}
return false;
}