2026-03-22 20:47:42 +01:00
|
|
|
bool M_CheckWigsLastCandles(E_DIRECTION eDir, int nNumberOfCandles)
|
|
|
|
|
{
|
|
|
|
|
for(int i = 1; i <= nNumberOfCandles; i++)
|
|
|
|
|
{
|
2026-03-23 18:58:15 +01:00
|
|
|
double candleSize = stGVL.Candle[i].high - stGVL.Candle[i].low;
|
2026-03-22 20:47:42 +01:00
|
|
|
if(candleSize == 0)
|
|
|
|
|
continue;
|
|
|
|
|
|
2026-03-23 18:58:15 +01:00
|
|
|
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;
|
2026-03-22 20:47:42 +01:00
|
|
|
|
|
|
|
|
double upperPercent = (upperWick / candleSize) * 100.0;
|
|
|
|
|
double lowerPercent = (lowerWick / candleSize) * 100.0;
|
|
|
|
|
|
2026-03-23 18:34:53 +01:00
|
|
|
if(eDir == DIR_LONG && upperPercent > nMinWigSizePercent)
|
2026-03-22 20:47:42 +01:00
|
|
|
return true;
|
|
|
|
|
|
2026-03-23 18:34:53 +01:00
|
|
|
if(eDir == DIR_SHORT && lowerPercent > nMinWigSizePercent)
|
2026-03-22 20:47:42 +01:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|