As both buybacks and earnings calendars are now available in pipeline, this example algorithm is the first I’ve written to trade on more than one event. If you’d like to learn more about trading on buyback announcements or earnings surprises, please view the original posts for share buybacks and earnings surprises.
I’m trying something new by providing a much more in-depth descriptions of the data feeds and custom factors used. Let me know if it’s helpful. You'll find dataset descriptions, custom factor descriptions, and strategy description as you read through.
- Universe filter: We look at only the top 1,000 most liquid securities.
- Event filter: Each event (earnings surprise & buyback) must have an article sentiment greater than .45 for long positions and less than -45 for short positions.
- Long Positions: Positive earnings surprises and new buyback authorizations are included in long positions.
- Short Positions: Negative earnings surprises make up all the short positions that we hold in this algorithm.
- Weights: The weight for each security is determined by the total number of longs and shorts we have in that current day. So if we have 2 longs and 2 shorts, the weight for each long will be 50% (1.0/number of securities) and the weight for each short will be -50%. This is a rolling rebalance at the beginning of each day according to the number of securities currently held and to order.
- Capital base: $1,000,000
- Profit and Loss limits are set to 6%
- Days held: Positions are currently held for 4 days but are easily changeable by modifying 'context.days_to_hold'
- Surprise Percent threshold: Only earnings surprises between 0% and 6% in absolute magnitude will be considered as a trading signal. These are adjustable using the minimum and maximum threshold variables in context.
- Trade dates: All trades are made 1 business day AFTER an event regardless of whether it was a Before Market Open or After Market announcement
For all examples using data, visit the data pipeline factor library.