mirror of
https://github.com/softwaredevelop/mql5.git
synced 2026-08-23 09:18:05 +00:00
refactor(scripts): ADVANCED ABSORPTION LOGIC
This commit is contained in:
@@ -572,19 +572,55 @@ bool RunQuantAnalysis(string sym, QuantData &data)
|
|||||||
// COMPOSITES
|
// COMPOSITES
|
||||||
// =================================================================
|
// =================================================================
|
||||||
|
|
||||||
// Using Last Closed M15 for pattern recognition safety
|
// =================================================================
|
||||||
|
// ADVANCED ABSORPTION LOGIC (Wyckoff Effort/Result)
|
||||||
|
// =================================================================
|
||||||
|
// Using Last Closed M15 Bar for pattern validation
|
||||||
int idx_cl_mid = idx_l2 - 1;
|
int idx_cl_mid = idx_l2 - 1;
|
||||||
|
|
||||||
if(idx_cl_mid >= 0 && mid_atr > 0)
|
if(idx_cl_mid >= 0 && mid_atr > 0)
|
||||||
{
|
{
|
||||||
double body = MathAbs(mid_c[idx_cl_mid] - mid_o[idx_cl_mid]);
|
double body = MathAbs(mid_c[idx_cl_mid] - mid_o[idx_cl_mid]);
|
||||||
double bar_rvol = Calc_RVOL(mid_v, InpRVOLPeriod, idx_cl_mid);
|
double total_range = mid_h[idx_cl_mid] - mid_l[idx_cl_mid];
|
||||||
if(bar_rvol > 2.0 && body < (0.4 * mid_atr))
|
|
||||||
data.absorption = "YES";
|
// Calculate specific bar RVOL using helper
|
||||||
|
// Note: We use a local calculator instance to be safe or reuse helper logic
|
||||||
|
CRelativeVolumeCalculator rv_calc;
|
||||||
|
rv_calc.Init(InpRVOLPeriod);
|
||||||
|
double bar_rvol = rv_calc.CalculateSingle(ArraySize(mid_v), mid_v, idx_cl_mid);
|
||||||
|
|
||||||
|
bool high_effort = (bar_rvol > 2.0);
|
||||||
|
bool low_result = (body < (0.35 * mid_atr)); // Stricter 35% ATR rule
|
||||||
|
|
||||||
|
data.absorption = "NO"; // Default
|
||||||
|
|
||||||
|
if(high_effort && low_result)
|
||||||
|
{
|
||||||
|
// Analyze Close Position relative to High-Low Range
|
||||||
|
// Position 0.0 (Low) to 1.0 (High)
|
||||||
|
double close_pos = 0.5;
|
||||||
|
if(total_range > 0)
|
||||||
|
close_pos = (mid_c[idx_cl_mid] - mid_l[idx_cl_mid]) / total_range;
|
||||||
|
|
||||||
|
if(close_pos > 0.66)
|
||||||
|
data.absorption = "BULL_ABS"; // Closing High = Demand absorbed Supply
|
||||||
|
else
|
||||||
|
if(close_pos < 0.33)
|
||||||
|
data.absorption = "BEAR_ABS"; // Closing Low = Supply absorbed Demand
|
||||||
|
else
|
||||||
|
data.absorption = "NEUT_ABS"; // Doji-like struggle
|
||||||
|
}
|
||||||
else
|
else
|
||||||
data.absorption = "NO";
|
if(bar_rvol > 3.5 && body < (0.6 * mid_atr))
|
||||||
|
{
|
||||||
|
// Volume Climax: Excessive volume with moderate move implies churn/exhaustion
|
||||||
|
data.absorption = "CLIMAX";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
data.absorption = "-";
|
data.absorption = "-";
|
||||||
|
}
|
||||||
|
|
||||||
// MTF Align (Based on TSI Histogram Direction)
|
// MTF Align (Based on TSI Histogram Direction)
|
||||||
// + Hist = Bull pressure, - Hist = Bear pressure
|
// + Hist = Bull pressure, - Hist = Bear pressure
|
||||||
|
|||||||
Reference in New Issue
Block a user