TL;DR: I built an algo with Xynth that trades small cap stocks with clustered insider buyers, non-routine insider purchases, and large positional entries on common stock by company executives.
Disclaimer: I built this algo with AI and it's only been running for 4 months so my winrate, drawdown, and profit factor are probably skewed. I'm also iterating the strategy after every trade (it's visible in my PnL everytime i iterate) and still continuing to optimize it. Still figured it was worth posting as I have been fairly profitable, and wanted to provide this for anyone looking to do something similar with AI.
To preface, I've been algo trading with ai for the last year now. Its capabilities in coding are strong enough to create really any strategy but it’s up to you to iterate on them until they are profitable. If you want to build this strategy with Claude, you just need to plug in every data source you’d want through an API.
So the idea of my strategy is fairly simple: Multiple company executives significantly increasing their positions within a similar time frame is a signal that you should do the same. Now as easy as that sounds in principle, there are a lot more steps you need to take to ensure whether a signal really means anything.
After getting tired of prompting this every single time I decided to turn it into an automation or yeah I guess a signal for a lack of better term.
STEP 1: Filtering for Open Market purchases on Common stock.
The first step filters SEC Form 4 filings for open market purchases of common stock. Open market purchases are basically just insiders buying their own company's stock with personal capital, flagged by transaction code P on the filing. We restrict to common stock because preferred shares, warrants, and convertibles carry more complex signals tied to hedging, and other stuff. I personally only trade off common stock because it just makes the most sense to me (and in my opinion its the easiest to read), but trade at your own volition.
Prompt 1: “Scan SEC form 4 filing for open-market stock purchases. Only look for transaction Code P. Once you have that filter for the common stock purchases”
STEP 2: Market cap.
This next step filters the following stocks for a market cap under 500m. Why? Basically large cap insider buys get picked up almost instantly by institutional algorithms and are priced within minutes. Small caps fly under the radar because big funds literally cannot build meaningful positions due to liquidity constraints on the stock. The smaller the company, the fewer eyes on the filing, and the more edge you’ll have.
Prompt 2: “Filter the following candidates for a market cap of under 500M”
Step 3: Insider Cluster.
This step, by far, is the most important one. If anyone is looking to emulate anything about this strategy this is the only step that is absolutely crucial.
You're basically looking for a unique cluster (2+ minimum) of insiders within a similar time frame (10-14 days is optimal). These insiders have to be C-suite meaning they are, Chief executive officer (ceo), Chief technology officer (CTO), Chief Operating Officer (COO), etc. You then wanna check their form 4 history to determine whether the purchase is just a routine buy or not. If it is a routine buy, it means they are not buying off any special signal.
Note: The larger the cluster and closer the time frame, the stronger the signal. For example: 1 insider purchase on its own means nothing. But when you get multiple insiders buying within the same 14 day window, that's a much stronger signal that something bullish is coming.
Prompt 3: “Filter the following candidates for:
- C-suite insider purchases
- 2+ insiders within 14 day time frame
- Non routine purchases from their form 4 history”
STEP 4: Material relativity of Purchase.
This step pulls total annual compensation (salary + bonus + stock awards) from the most recent proxy filing (DEF 14A). You want to do this to get a gauge on how much the insider is actually risking. Basically your asking yourself “What is the strength of the hunch the insider is actually going off of”. In general, the purchase from each insider should exceed 5-10% of there total annual compensation. A CEO making $2M/year buying $150K is meaningful at 7.5% of comp. A CEO making $25M/year buying $150K is weaker at 0.6%.
Also, purchases that increase the insider's total position by more than 10% are the strongest signal. The gold standard is an insider going all-in, concentrating both net worth and career risk into the same stock. Nobody with negative information is gonna do that.
Prompt 4: “Filter the following candidates for purchase from a company executive (CEO, CFO, etc) that exceeds 5-10% of the persons annual compensation (salary + bonus + stock awards), or purchases that increase the executives position by 10%+”
STEP 5. Trade setup.
I use a 15% trailing stop. Once the stock moves up 15% from my entry, the stop activates and trails the price. From that point on, I exit the moment it drops 15% below its highest point since entry.
So if I buy at $100 and it runs to $150, my stop sits at $127.50 (15% below $150). If it keeps climbing to $200, the stop moves up to $170. I only get taken out when the price pulls back 15% from whatever the peak is.
I initially used a 10% trailing stop but all my exits happened right before the signal would actually kick in but I think 15% is the sweet spot between risk, and time frame. Again, this is one of those things you could try for yourself, and determine what actually works best for you.
***Prompt 5: “***Give me a trade entry for a trailing stop of 15%”
AGAIN, a lot of this strategy came from and was developed with the use of AI backed by months of paper trading and backtesting. So if you feel that any step/criteria is unnecessary or needs improvement feel free.
Now this strategy really isn’t a complete algo, you're still gonna have to make it into a signal generator that pings you every time a stock passes all the filters. With xynth you can prompt this rather quickly but with claude you’d have to take the code and manually set it up yourself. I do heavily recommend you do set this up though (so your alerted every time your strategy hits) as, at most, you’ll be getting 1-2 viable candidates per week.
Prompt: “have this strategy constantly running in the background and alert my email every time there is a new candidate”
I recently saw redditor u.trontonian post a strategy with a very similar thesis as mine. If you wanna see that post, it should be under his profile. (Sorry, mods won't let me link his post)
But apart from that, good luck. I hope this post was informational and helpful to any of you that needed it.
Cheers!