Announcement

Collapse
No announcement yet.

Getting high/low in range

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting high/low in range

    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;
    }
    Standing on the shoulders of giants.

  • #2
    wildfiction
    You could also use the Donchian Channel
    Alex

    Comment


    • #3
      Good idea - thanks Alexis
      Standing on the shoulders of giants.

      Comment

      Working...
      X