Description: The combin function is a the combination function as it calculates the number of possible combinations for two given numbers. This function takes two arguments: the number and the number_chosen. For example, if the number is 5 and the number chosen is 1, there are 5 combinations, giving 5 as a result.
combin(n, kin) Returns the number of combinations for a given number of items. Use to determine the total possible number of groups for a given number of items. Parameters: n: int, The number of items. kin: int, The number of items in each combination. Returns: int.
In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in a publication is governed by House rules.
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.