by Apprentice » Sat Jan 21, 2017 4:22 am
U can use this line to Finds both the minimal and the maximal value in the range.
local Min,Max= mathex.minmax(source, period-N+1,period);
local Ratio= Min/Max;
or
local Min= mathex.min(source, period-N+1,period);
local Max= mathex.max(source, period-N+1,period);
local Ratio= Min/Max;
or
local Min= mathex.min(source.high, period-N+1,period);
local Max= mathex.max(source.low, period-N+1,period);
local Ratio= Min/Max;
To have "Highest/Lowest value offset for a given number of bars back" use
source.high[period-N]/source.low[period-N]