Firetron’s FractionMiddle

2 582 Views No Comments 3 years ago
  • Finds the middle value of a fractional portion of a table of values.

    Custom Command Dependencies:
    Firetron’s FractionGrab
    Firetron’s Median

    Test code:

    if not Load('done', false) then
      local list = Grab(ClosePrices(), 0, 12)
      Log(' ')
      Log('Unsorted List:')
      Log(' ')
      Log('Sorted List:')
      Log(' ')
      local median = CC_FractionMiddle('median', list, 3, 4)
      Log('Median Value of 3rd portion of 4:')
      Log(' ')
      local average = CC_FractionMiddle('average', list, 3, 3)
      Log('Average Value of 3rd portion of 3:')
      Log(' ')
      median = CC_FractionMiddle('median', list, 1, 3)
      Log('Median Value of 1st portion of 3:')
      Log(' ')
      Save('done', true)
    • This topic was modified 3 years ago by Firetron. Reason: Made all parameters optional
    • This topic was modified 3 years ago by Firetron. Reason: Extracted FractionGrab to another command
    HaasScript Code
    Sign in or Register to download for free
Login or Register to Comment

Unlock your crypto trading potential

Create a free account and enjoy everything we have to offer.

Join for Free