Thanks for that link. Gives me an inspiration for functions that can then be used to train an ML model or for a ranking system. I'm just throwing out some ideas. We have not started defining the more complex aggregation functions.
Cluster buying/selling (distinct insiders)
InsBuyers(days [, max_score])
InsSellers(days [, min_score])
Total Amount
InsBuyAmt(days [, max_score])
InsSellAmt(days [, min_score])
Buys Win Rate
Calculate the win rate of the buys in a period. Can specify sector, industry, etc
InsBuy1YWinRate(future_days [, scope, max_score])
InsBuy3YWinRate(future_days, [, scope, max_score])
Buys Avg Return.
Averages the future performance of all the buys in a period. Can specify sector, industry, etc
InsBuy1YAvgRet(future_days [, scope, max_score])
InsBuy3YAvgRet(future_days, [, scope, max_score])
Examples
How many distinct bullish or very bullish (P123 score 1-2) in the past 30 days
InsBuyers(30, 2)
How many distinct very bearish sellers in the past 30 days
InsSellers(30, 5)
Sector future 1Mo win rate for insiders that bought with conviction in the past year
InsBuy1YWinRate(30, #sector, 1)