mirror of
https://github.com/softwaredevelop/mql5.git
synced 2026-07-27 20:47:44 +00:00
refactor: Upgraded with dynamic volume routing to support VWMA Slowing/Signals
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
//| Copyright 2026, xxxxxxxx|
|
||||
//+------------------------------------------------------------------+
|
||||
#property copyright "Copyright 2026, xxxxxxxx"
|
||||
#property version "2.20" // Added fixed digits precision
|
||||
#property version "2.30" // Upgraded with dynamic volume routing to support VWMA Slowing/Signals
|
||||
#property description "Barbara Star's DMI Stochastic Oscillator. Supports Standard and Heikin Ashi sources."
|
||||
|
||||
//--- Indicator Window and Plot Properties ---
|
||||
@@ -114,7 +114,18 @@ int OnCalculate(const int rates_total,
|
||||
if(CheckPointer(g_calculator) == POINTER_INVALID)
|
||||
return(0);
|
||||
|
||||
g_calculator.Calculate(rates_total, prev_calculated, open, high, low, close, 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, volume, BufferK, BufferD);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_calculator.Calculate(rates_total, prev_calculated, open, high, low, close, tick_volume, BufferK, BufferD);
|
||||
}
|
||||
|
||||
return(rates_total);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user