Firetron’s FractionGrab

1 41 Views No Comments 4 weeks ago
  • Grabs a fractional range from an array, list, or table.

    Custom Command Dependencies:
    None

    Test code:

    if not Load('done', false) then
    
      local list = Grab(ClosePrices(), 0, 12)
    
      Log(' ')
      Log(list)
      Log('Unsorted List:')
      Log(' ')
    
      local unsorted_3_4 = CC_FractionGrab(list, 3, 4, false)
    
      Log(unsorted_3_4)
      Log('3rd part of 4 unsorted:')
      Log(' ')
    
      Log(ArraySort(list))
      Log('Sorted List:')
      Log(' ')
    
      local sorted_3_3 = CC_FractionGrab(list, 3, 3, true)
    
      Log(sorted_3_3)
      Log('3rd part of 3 sorted:')
      Log(' ')
    
      local sorted_1_3 = CC_FractionGrab(list, 1, 3, true)
    
      Log(sorted_1_3)
      Log('1st part of 3 sorted:')
      Log(' ')
    
      Save('done', true)
    
    end
    HaasScript Code
    Sign in or Register to view
Login or Register to Comment

Unlock your crypto trading potential

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

Join for Free