Is there a better (faster/more efficient) way to get the high value in a range of bars?
function GetHighFromRange(start, len)
{
var retVal;
var highArray = high(-start, -len);
if(highArray.length > 0)
retVal = highArray[0];
else
return null;
for(i=1; i<highArray.length; i++)
{
retVal = Math.max(highArray[i], retVal);
}
return retVal;
}
function GetHighFromRange(start, len)
{
var retVal;
var highArray = high(-start, -len);
if(highArray.length > 0)
retVal = highArray[0];
else
return null;
for(i=1; i<highArray.length; i++)
{
retVal = Math.max(highArray[i], retVal);
}
return retVal;
}
Comment