Skip to Main Content

02/21/2023 |

TrendSpider Software Update: Strategy Testing Events

Hello, traders, and welcome to another software update! In this update, we’re excited to bring some valuable new functionality to our Strategy Tester; The ability to strategy test events including earnings dates, dividend dates, split dates, and analyst estimates. Details after the jump!

Have you ever found yourself perplexed by a move in a stock following its earnings announcement? Are you curious to know if there is a particular analyst who really has the power to affect the price of a stock? Maybe you have a refined strategy that you currently employ but want to test how it does if it avoids important events like ex-dividend dates or split dates. All of this is possible, and more, using the new Events parameters within the strategy tester!

How To Use Events In Your Strategy

In order to utilize events within your strategies, simply click the ‘Add Parameter’ button and scroll down to the bottom of the list to select the desired event. You’ll input your event conditions in the exact same way that you would within the market scanner! Events can be utilized as entry or exit criteria, as well as filtering criteria for your favorite strategies. Let’s dig into the ways these new options can be used.

Strategy Test Performance Leading Up To Earnings

If you’ve traded for any amount of time, you’ve likely gambled on an earnings announcement. Earnings announcements can be particularly volatile, but now you can have a better understanding of how a stock performs leading up to its earnings announcement or in the days that follow.

In order to strategy test how a stock performs leading up to earnings, simply go to your entry field and select the ‘Earnings’ parameter option. Next, define it as occurring ‘Within the next X days’ and then define the number of days before the announcement that you’d like to be triggered into a trade. The input will appear as in the image below.

A image showing input parameters to script earnings in TrendSpider's strategy tester.

In order to exit before the announcement, you can try utilizing the ‘# Candles Passed’ exit prompt or the same prompt as in the image above but with a smaller value!

Strategy Test Performance After Earnings

In order to strategy test the historical performance of a stock after its earnings announcement, again you’ll utilize the ‘Earnings’ parameter option, but in this case, you’ll define it as occurring ‘Today’.

A image showing input parameters to script earnings in TrendSpider's strategy tester.

The strategy tester will enter you into the trade on the open of the candle that directly follows the earnings date, and you can choose any number of exit criteria to get yourself out of the trade. This is a great way to glean insights like average gain or loss ‘x number of days after earnings’ or even quickly see how a stock has reacted to earnings recently.

Strategy Test Analyst Upgrades and Downgrades

If you’ve ever been curious to know how analysts really affect a stock’s price, now you can do so easily using the ‘Analyst Estimates’ parameter. Here, you’ll be able to define blanket actions like ‘Any analyst upgrade or downgrade’ or even get specific by defining a particular analyst. If you’ve ever heard that an analyst or institution has a good track record on a stock, this is your way to find out if that’s really true!

In the below image, we’ve defined that we want to enter into a trade when an analyst from Jefferies has upgraded the stock. Just as in the earnings setups discussed above, analyst estimates can be used as entry or exit criteria.

A image showing input parameters to script analyst estimates in TrendSpider's strategy tester.

Adding Events As Fliters To Your Current Strategy

If you have a strategy, or strategies, that you currently employ but would like to avoid being in trades during things like earnings announcements, split dates, or dividend dates, it’s also possible now to utilize these events as filtering criteria.

For example, let’s say you prefer to be on the sidelines for an earnings announcement but your current strategy triggers an entry the day before. If you’d like to avoid this, simply define it in your entry criteria using a condition group. In the below image, we’ve defined our entry as the 8 EMA crossing up on the 21 EMA, but we’ve also now defined not to enter into this trade if earnings are within the next 5 days.

A image showing input parameters to script mixed event and technical conditions in TrendSpider's strategy tester.

This same functionality can be applied as an exit filter. For example, let’s say a stock that you trade has a quarterly dividend. Maybe you’ve observed over time that price tends to run into the dividend date but sells off just before it and you’d like to avoid that sell-off.

You can use the ‘dividend date’ parameter within your exit conditions. In the image below, we’ve defined both our standard exit, the 8 EMA crossing down on the 21 EMA, and we’ve added a parameter that defines exiting the trade if the ex-dividend date is within the next two days. We’ve utilized the ‘Any of the following’ option to tell our system to exit if either of these conditions is true.

A image showing input parameters to script dividends in TrendSpider's strategy tester.

Something To Remember

It is important to note that these event conditions all operate using calendar days while the candles on your charts reflect business days. When utilizing events in your backtesting, please be sure to consider the discrepancies that may appear to occur and factor in weekend days accordingly.

As is true with all of our updates, we hope you find this one helpful to your analysis! If you have any questions, feel free to reach out to our support team using the ‘Contact Us’ button in the bottom right corner of your platform view.