From b39047d5ff2e294aacae3a9a194bbdee150cc0d5 Mon Sep 17 00:00:00 2001 From: Toh4iem9 Date: Wed, 24 Sep 2025 12:34:50 +0200 Subject: [PATCH] refactor: prices --- Include/MyIncludes/RSI_Pro_Calculator.mqh | 31 ++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/Include/MyIncludes/RSI_Pro_Calculator.mqh b/Include/MyIncludes/RSI_Pro_Calculator.mqh index bdb23f7..80d75d5 100644 --- a/Include/MyIncludes/RSI_Pro_Calculator.mqh +++ b/Include/MyIncludes/RSI_Pro_Calculator.mqh @@ -215,7 +215,36 @@ bool CRSIProCalculator_HA::PreparePriceSeries(int rates_total, ENUM_APPLIED_PRIC ArrayResize(ha_close, rates_total); m_ha_calculator.Calculate(rates_total, open, high, low, close, ha_open, ha_high, ha_low, ha_close); - ArrayCopy(m_price, ha_close, 0, 0, rates_total); +//--- Corrected: The HA version now uses the selected price type from the HA candles + switch(price_type) + { + case PRICE_CLOSE: + ArrayCopy(m_price, ha_close, 0, 0, rates_total); + break; + case PRICE_OPEN: + ArrayCopy(m_price, ha_open, 0, 0, rates_total); + break; + case PRICE_HIGH: + ArrayCopy(m_price, ha_high, 0, 0, rates_total); + break; + case PRICE_LOW: + ArrayCopy(m_price, ha_low, 0, 0, rates_total); + break; + case PRICE_MEDIAN: + for(int i=0; i