This sample algorithm builds off the well known PEAD effect. It uses the Street's consensus (average analyst estimate) and compares it to the actually reported earnings after an announcement. In comparison to traditional PEAD strategy, this one also uses NLP based news sentiment to validate long/short positions before entrance (long on positive surprise and positive sentiment and vice versa for shorts).
This one is based off of Wall Street analyst estimates instead of the crowd which I've released a strategy on before.
Strategy Details:
- Data set: Analyst Earnings Surprises by Zacks, and news sentiment by Accern
- 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'
- Percent threshold: Only 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.
- Earnings dates: All trades are made 1 business day AFTER an earnings announcement regardless of whether it was a Before Market Open or After Market announcement
- Universe: It filters for the top 1500 liquid securities using the mechanisms found in the Q1500 (https://www.quantopian.com/posts/the-q500us-and-q1500us)