mirror of
https://github.com/softwaredevelop/mql5.git
synced 2026-08-05 16:47:44 +00:00
refactor: Upgraded with dynamic volume routing to support VWMA Slowing/Signals
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| Stochastic_Adaptive_Pro.mq5 |
|
||||
//| Copyright 2025, xxxxxxxx|
|
||||
//| Copyright 2026, xxxxxxxx|
|
||||
//+------------------------------------------------------------------+
|
||||
#property copyright "Copyright 2025, xxxxxxxx"
|
||||
#property version "2.00" // Refactored to use MovingAverage_Engine
|
||||
#property copyright "Copyright 2026, xxxxxxxx"
|
||||
#property version "2.10" // Upgraded with dynamic volume routing to support VWMA Slowing/Signals
|
||||
#property description "Frank Key's Variable-Length Stochastic, using Kaufman's ER."
|
||||
#property description "Dynamically adjusts its period based on market trendiness."
|
||||
|
||||
@@ -39,10 +39,8 @@ input int InpMaxStochPeriod= 30; // Maximum Stochastic Per
|
||||
|
||||
input group "Stochastic & Price Settings"
|
||||
input int InpSlowingPeriod = 3;
|
||||
// UPDATED: Use ENUM_MA_TYPE
|
||||
input ENUM_MA_TYPE InpSlowingMAType = SMA;
|
||||
input int InpDPeriod = 3;
|
||||
// UPDATED: Use ENUM_MA_TYPE
|
||||
input ENUM_MA_TYPE InpDMAType = SMA;
|
||||
input ENUM_APPLIED_PRICE_HA_ALL InpSourcePrice = PRICE_CLOSE_STD;
|
||||
|
||||
@@ -105,7 +103,18 @@ int OnCalculate(const int rates_total,
|
||||
else
|
||||
price_type = (ENUM_APPLIED_PRICE)InpSourcePrice;
|
||||
|
||||
g_calculator.Calculate(rates_total, prev_calculated, open, high, low, close, price_type, BufferK, BufferD);
|
||||
//--- Determine best volume array (Use Real Volume if available, otherwise fallback to Tick Volume)
|
||||
long volume_limit = (long)SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_LIMIT);
|
||||
|
||||
//--- Delegate calculations dynamically to support volume-weighted types (VWMA) on Slowing/Signal
|
||||
if(volume_limit > 0)
|
||||
{
|
||||
g_calculator.Calculate(rates_total, prev_calculated, open, high, low, close, price_type, volume, BufferK, BufferD);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_calculator.Calculate(rates_total, prev_calculated, open, high, low, close, price_type, tick_volume, BufferK, BufferD);
|
||||
}
|
||||
|
||||
return(rates_total);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user