A Trader Journal

Change yourself, change your trading.

Enhancing TA trading rules performance using filtered Price Bars

Volatility is an interesting subject. For some it is risk and for others it is opportunity. In a way I think it is both. For a trader, price volatility creates opportunity whereas portfolio volatility creates risk.

Typically in statistical sampling, extreme outliers are treated as spurious samples and left out. That way the sampled data can fit nicely with more elegant statistical distributions and can be explained well by models. On other hand the premise of technical analysis is "markets are inefficient and one can profit from these inefficiencies".

TA typically assumes the market price moves are a proxy for the information content and price inefficiencies. So technical trading rules typically have a price & time scale parameter like number of days for purpose of smoothing data, to reflect some cycle length and to identify market inefficiency to profit. So far good.

When it comes to markets, the days with large price moves are the ones that reflect most the inefficiencies and also trigger the most emotions. Now a rarely asked but important question is would your technical indicators yield better performance when you consider only information rich large price move days versus considering all days? 

I recently came across a paper that targets this question. What the author does is uses volatility as a filter to screen out noise (i.e., flat days) and include only days that are rich in information. Once these flat days are filtered out, then the author applies the same trading rules on non-filtered days and does before-n-after trading rules performance comparison.

So what are filtered days?
The paper first defines a threshold and then uses this threshold to filter out some of the days in the sample. The threshold is for example like a 25% of sample daily return's standard deviation of the full set. Now using this threshold, we filter out nearly all flat days (i.e., days with gain or loss less than threshold) from the full sample. The days of interest to us here is the retained set i.e., non-filtered days in the sample.

Trading Systems & Data
To validate whether this filtering helps, the paper picks three trading rules/systems and compares the performance of these three systems on full sample data vs performance on retained data (i.e., data where flat days were filtered out). The data is SPX daily index for last 23 years i.e., 1990-2012. I think this is long enough data.

Short Term System: 2 day run mean reversion
Rules:
  • Long 100% in SPX at the market close of a trading day when index has been down 2 days in a row.
  • Short 100% in SPX at the market close of a trading day when index has been up 2 day in a row.
  • Continue with current position (long or short) till a switching conditions has not been met. 
Filtering schemes:

  • Scheme 1 - Apply a fixed filter i.e., ignore days that have less than 25% of SPX daily return standard deviation. The standard deviation was calculated for the entire period.
  • Scheme 2 - Filter all days that have returns less than 20% of SPX daily return standard deviation. This standard deviation was calculated on last 60 days of rolling window.
  • Scheme 3 - Filter all days where threshold is 22% of current SPX index option implied volatility.

The concept applied for short term system is basically ignore nearly flat days and focus on market moving days to improve your short term trading rules performance. This is similar to volatility filtering systems that one hears about in TA.

I am not sure filtering schemes 1 & 3 would be robust. I generally prefer to stay away from thresholds that are absolutes. Also these two filtering schemes has a look ahead bias.

Intermediate Term System: Dual Moving Average Cross (DMAC) 
Rules:
  • Go Long when short term moving average crosses above long term moving average
  • Go Short when short term moving average crosses below long term moving average.
Filtering scheme:
  • Filter all days whose daily returns are less than 0.25% daily returns of SPX when computing SMA and LMA.

The concept that gets applied indirectly here for intermediate term system (i.e., MA system) is to increase the MA length when there are many flat days. So in other words the simple MA becomes an adaptive MA.

I am not fully convinced yet that filtering out nearly flat days is the way to apply this concept. Part of the reason is most bars effect (unless they were in key locations) will fizzle out in few days. Whereas the system we are talking here is intermediate term system. Another reason is the equity curve seems bad last 3-4 years. Don't know if it is due to change of market character since financial crisis and popularity of risk aversion.

Long Term System: Price Channel Trading
Rules:
  • Switch to long when  close is greater then m day price channel high.
  • Switch to short when close is below the m day price channel low.
Filtering schemes:
  • Filter all days in channel calculations whose daily returns are less that 0.25% of daily SPX return.

Here I am not sure why the filtering scheme is improving the performance. Basically what we are saying is when we have too many flat days, then increase the channel look back period. I would think the other way (i.e., decreasing the the channel look back period when too many flat days) would be more profitable. The rationale - volatility contraction.

Concluding thoughts:
I think on the whole the core concepts in this paper are good. But on other hand, I don't feel comfortable with absolute thresholds and especially if they were calculated by looking ahead.

My main take away from the paper is utilizing of this filtering concept but probably in a different way for a short term system. For intermediate and long term systems, probably I will skip this concept for now.

For any one interested in reading full paper, following are the details -
Source - "Filtered Market Statistics and Technical Trading Rules", George Yang, May 2013.

Wish you all good health and good trading!!!

Sector Rotation trading using Credit Markets

Recently I came across an interesting research paper on sector rotation. This paper won NAAIM 2013 Wagner award. First time when this came across my desk, I nearly skipped it. There are so many papers on momentum and most of them follow nearly same recipe. The primary difference typically is in the criteria being used to construct the rank. But given the paper got award, I felt curious and wanted to see what is different about this paper methodlogy to get an award.

Core idea:
The core principle of the paper is "equity values drop when credit risk rises and vice versa". This paper applies this relationship at index level. The method here is a long-only strategy and uses SPDR sector ETFs (XLE, XLY...) as the assets to rotate for the portfolio. Methodology:
  • Select a credit index or basket of credit instruments as proxy for credit risk to the portfolio. The credit index chosen here is Bank of America/Merrill Lynch's US High Yield B index i.e., HY/B.
  • Using 6 month time frame (i.e., 26 weeks, weekly frequency) calculate a fair value for each sector ETF utilizing HY/B index values. The model is calibrated via Ordinary Least Squares (OLS) linear regression. Look at the figure below for a better explanation.
    • ETF fair(HYB market) = A * HYB market + B 
  • Then estimate the disconnect for each sector ETF i.e., calculate how far, on a percentage basis each sector ETF is away from fair value using below formula. Given it is regression based, some ETF disconnect values will be positive and for other ETFs it would be negative values.
    • ETF disconnect = [ETF fair - ETF market] / ETF market
  • Now rank the ETFs in descending order of their disconnect values. The idea being the top ranked ETFs have the greatest disconnect and so should generate high returns relative to the bottom ranked ETFs.
  • Buy the top ranked N assets. Replace them in portfolio whenever the top ranked assets change. Assume an Equal-Weighting scheme for portfolio sizing.
Do the above steps each week. One can instead do monthly frequency also. Under monthly frequency model, the returns and number of trades will be lower.

Twist:
One problem with the above is, in times of market stress, the portfolio will have severe drawdowns. If you had noticed, in the above model, we ignored the sign of disconnect values and just ranked all of them. So one twist is to utilize the sign of disconnect values (postive or negative) and play the tactical asset allocation game i.e.,
  • Each week, choose the N top-ranked ETFs.
  • For each of the chosen ETFs:
    • If the fair value is greater than market value (i.e., plus sign), then invest the asset share in that ETF.
    • If not, then invest the asset share in 3-month Treasuries instead. Notes:
Some Notes:
  • The paper uses previous 26 weeks of data exclusive of the current trading day to build the regression. Similarly HY/B value is published the following day. So the model uses previous day's HY/B value to calculate fair value for each ETF.
  • 6 month (i.e., 26 week) time frame is chosen as the authors felt it is long enough to develop a meaningful relationship between credit index and market but short enough to detect regime changes quickly.
  • The HY/B index values are obtained from FRED database. The sector ETFs values are obtained from Yahoo finance. The model in paper assumes equal-weighting of the assets in the portfolio.
This pretty much sums the methodology of this paper.



Why credit markets as the proxy?
The basic idea is a firm's asset value, equity value and its debt are interconnected i.e., related to each other. This relation was proposed by Robert Merton and that model goes by the name "Merton Model". Now the same concept applies at index level as well.

Merton Model - Think of equity of a company as an European call option on the firm assets i.e., you pay the premium today and when the call option matures, you get to cash in by selling it. Similarly think of liabilities/debt as the option strike price. Now think of the firm's asset value as the instrinsic value of the option. So the profit you get on call option at maturity is whatever value of the option is on that day - the strike price of the option - the premium you paid. This model seems can be used to estimate the probablity the company will go belly up (i.e., default) as well as the credit spread on the debt. Anyway, this is what I understood from a quick google search.

This paper uses the corporate credit spreads as the proxy for the credit risk. So for implementation, the paper uses the option-adjusted spreads for Bank of America/Merrill Lynch's US High Yield B index i.e., HY/B as proxy. Note: the paper uses same credit index i.e., HY/B as proxy to judge relative value for all equity assets in the portfolio.

Model characteristics:
In declining markets, the strategy would help in limiting losses. On other hand, in bull markets the strategy will throttle gains. The reason being the strategy is generally invested atleast partially in Treasuries. Overall the tradeoff of lower gains in up markets is countered by limiting the portfolio drawdown. It is psychologically challenging to the investors.

If the investor takes a long view i.e., a lower volatility strategy that limits drawdowns can be far more desirable then a buy-n-hold strategy or one that exposes as portfolio to sharp market corrections. Unfortunately many feel satisfied more based on relative comparisons with joneses than with absolute comparisons.

It is more suitable for investors who take 2-3 year view for the strategy compared to the ones who focus more on short term results.

Source Paper: Equity sector rotation via credit relative value

Wrap up:
My guess is this paper got award due to the relative value concept i.e., using credit index as proxy to calculate the fair value of the underlying asset and use the disconnect from value as the criteria for ranking the assets. On the whole, it is a good paper and interesting concept.

Though the returns are good the volatility and drawdown numbers are bit high. I think it would be a good strategy to consider if one can figure a way to reduce the drawdowns and volatility of the strategy returns. Some areas to investigate would be like using volatility targeting instead of equal-weighting scheme. Another would be using strategy diversification. When I get more time, I want to test this strategy along with another momentum strategy and see how the correlations would look like.

Another area would be figuring out a better credit index proxy besides HY/B and is negatively correlated with equities. My knowledge about credit markets and financial engineering techniques is limited. I appreciate if any readers with deeper background in credit markets can suggest proxies alternative to HY/B that one can investigate.

Finally, nearly all the subscribers to this blog are by word of mouth. So my usual request - if you found this post useful then can you please share this blog with couple of your friends/colleagues. I appreciate it.

Wish you all good health & good trading!

Profiting from patterns in insider trades...

Few weeks back I came across an interesting paper on insider trading. This paper is about detecting patterns in trades made by insiders to identify suspicious trades for investigators and prosecutors. Another audience for the paper naturally is us i.e., traders/investors.

For example, can you tell from a set of insider trades which of the trades are made by an informed insider to take advantage of an information that is not yet public? Can you figure which of the trades of this informed insider are to capitalize on private information that is short lived in nature? How about figuring which of the insider trades are to capitalize on private information that is long term in nature i.e., it will be revealed to public few months months down the line? 


Before diving into the journal paper, couple of points - 
  • There are many ways insiders can take advantage of private information like through options/insider phone tree/sharing with others knowingly/unknowingly etc. This paper primarily focuses on the publicly available trading records of the insider. 
  • To me no one single concept makes up a system. Also when I investigate journals, I don't look for a system. What I look for is ideas that I can later on investigate myself and may be mix & match with other ideas. A select few of these ideas become additional qualifiers (at process level) to my existing methods and contribute to position timing/sizing decisions.
So what are some insider trading patterns?
Often when articles on the net talk about analyzing insider trading, the typical suggestions are like those below 
  1. Insider purchases are good indicator of future prospects of the stock. That is the main reason for an insider to buy. 
  2. No reliable information from insider sales about future prospects of the stock. An insider might sell stock for any number of reasons like diversification or a need to raise money for some thing etc.
  3. Another type of suggestion - look at how insiders fared with their past purchases. If they did well then they might do well again.
  4. Similarly another type of suggestion - See how many insiders are purchasing? Also see what is the trend of insider purchases and sales. The idea here being the more insiders purchase the better it is.
  5. Another type of suggestion - See the dollar amounts of insider purchases or see the change in total holdings. The idea here being the bigger the amount the higher the confidence of insiders in future prospects of the stock.
Now while the above suggestions sound logical and may have an edge (which I don't know), one problem is they treat all insider trades as equal. Ok, some go little farther by differentiating the trades from executives and others. But one thing missing is they don't take into consideration the trading patterns/behaviors of the insiders. 

Pattern-1: Sequenced Trading Pattern
Not all private information is equal. Some private information has advantage that is longer lived. While other types of information has advantage that is only short lived. 

Consider a hypothetical company where the CEO/another C staff member of that company was involved in private negotiation with a key supplier or customer. Assume the outcome of these negotiations have long-term earnings implications. Now say the negotiations are not going well.

Obviously the insider will know that. The thing is this information has no near term earnings implication. Also this information will not be revealed to the public for another 6 months or so. So how would the executive take advantage of this insider information?

Given the executive is not in a hurry, the typical pattern is for the executive to spread their trades over several months. Also given the luxury of time, the insider likely might execute trades (reported to the SEC) on Fridays. Why Friday? I will cover this in a future post. Gist is, of all days of the week, Friday's have least investor attention. So why not take advantage of that as the insider have flexibility and less immediacy. 

Just FYI...it is ok if you feel the above info does not lend easily to quantify. For now go with concept level. Later in the post, I will write the objective rules to identify a sequenced trading pattern. If that is not sufficient and don't mind putting up with equations and extraneous stuff, then you can read the source paper itself.

Pattern-2: Isolated Trading Pattern
Say at a firm an executive have been receiving internal field reports of lower than expected sales reports. The executive knows that the firm is likely to miss its earnings in the near term. 

Now this is a short lived information and the insider has to act quickly before the information is revealed to the public. The insider in this case is most likely to engage in isolated (often singular trades) concentrated in a particular month. The paper calls these trades isolated trading pattern.

The idea behind this pattern is when insiders have access to short lived information, they most likely make isolated and often singular trades or trades that fall within same month (or 30 days).

As I mentioned earlier, this paper is  also for investigators/prosecutors. Now for them, they don't need to know an insider made the trade on private information before the information becomes public and market reflects that info in the stock price. 

I mean say an insider made trades following this pattern. After that soon the stock tanks/zooms up when the information becomes public. For investigator, that is enough to determine the trade is likely based on private information. But as traders we need to know that trade is likely based on private information before the market reflects private information.

From what I understood, at least in the paper there is no way to detect trades of Isolated Trading Pattern before hand. Also this pattern is a sub pattern of "Sequenced Trading Pattern" and there is no way to distinguish between these two patterns till a month passes by after the trade. The results in paper are for that one month where we were supposed to be waiting to determine the trade belongs to an Isolated Trading Pattern.

On other hand, we can identify Sequenced Trading pattern objectively. Also over several thousand samples, the data in the paper indicates a good positive edge for this pattern over multiple months. So in rest of the post, I will focus only on Sequenced Trading pattern.

How to identify a Sequenced Trading Pattern?
The rules for identifying sequenced trading pattern are
  • For each insider, aggregate all the trades on a calendar month basis.
  • The trades of the insider should occur in consecutive calendar months. If there is a gap of more than one calendar month between trades in the sequence then it is not a Sequenced Trading Pattern. 
  • Finally the insider trades are not routine trades. A trade is considered as routine trade if the insider has traded in same calendar month in three consecutive years.
Observations:
When I understood the rules, I thought there won't be that many samples. It is surprising that there are so many samples available as the below figure indicates.


Portfolio Construction?

If insiders engage in sequence of trades solely for diversification and liquidity purposes, then any portfolio constructed over sequenced trading pattern should have typical returns. On other hand, if there is private information that is being taken advantage by executive insiders then there would be good returns following their end of sequences and portfolio based on this pattern should have abnormal returns.

Rules:
  • At the beginning of each month, look for stocks that have "sequenced trading pattern".  Note: The earliest date we can determine a sequenced trading pattern is one calendar month after the last trade of the sequence is complete.
  • Add the stocks that meet the pattern criteria to the portfolio. 
  • Added stocks will be kept in the portfolio for the month.
  • Re-balance the portfolio at the beginning of the next month based on new stocks that complete the insider sequence trading pattern.
Results & Observations?

Following image provides the results of the sequenced trading pattern portfolio along with my annotations. Please see the images for context to below paragraph.





While the concept and results are interesting, what piqued my interest also is that (a) while the sequence is underway, the stock goes against the direction of the insider trades and (b) there is no return significance while the sequence is underway. Now add to that a price action entry technique to control risk. May be it is my contrary antennae going up but it feels that is a worthwhile and possibly another profitable angle for any interested readers.

To all readers, thank you for visiting my blog. I hope the above post is interesting and informative to you. Most of this site visitors are by word of mouth reference. So if you found this and other posts on the blog interesting and useful then please suggest the site to couple of your friends/colleagues. I appreciate it.

Source Paper: Insider Trading Patterns.


Side note:
I have not verified myself whether the pattern has positive edge.  I don't have access to historical insider trade data in a tabular/csv format. To get that data either one needs to subscribe to an expensive data feed (but I rarely trade stocks now) or write a robot to traverse and scrape SEC filings/pages to generate the data set automatically. I don't have time for the later option. Few weeks back I joined a very small but rapidly growing and cash flow positive firm. So now a days I don't get much time beyond firm work, trading and family. So I guess for now these action items are going into my trading BOT book. (BOT - Book of ToDo).

Wish you all good health and good trading!

Large price changes...Stock subsequent returns.

I came across an interesting study that was published last month. The study is about large price changes/swings and subsequent returns of the stock when this price change is based on new information. The study claims one can earn abnormal monthly calendar-time returns following their strategy after large price changes.

The core idea of the study is when there are large price swings there are two possible outcomes:
  1. The large price change is simply an aberration caused by noise and liquidity trades. In that case, it is likely that the price move will be followed by corrections and price reversals. (or) 
  2. The large price change/swing is caused by new information. If that is the case, then it is likely that the price will drift in the same direction of price change in subsequent weeks.
Ok. So far good. But how do we determine if a price change is based on new information? 

The study considers a large price change is based on new information if within 5 days of the large price change, the analysts following that stock issues either a earnings forecast revision (or) price target revision. In other words, if there is an immediate reaction from analysts following this stock, then the price change is considered to be based on new information.

Side note: The study has some additional observations with respect to analyst revisions and large price changes that I found interesting -
  • Majority of analysts do not revise their earnings and target price forecasts immediately following large price moves. In other words, most large price changes are not associated with new information and hence likely to reverse.
  • When analysts revise, often the revisions are more likely to be in the same direction as the price swing i.e., positive large price swing trigger positive earnings forecast or target price revisions and vice versa.
  • Analyst revisions are more often when trading volume around the price swings are high signifying arrival of new information.
  • Short term reversals are far less likely for large negative-return days  (compared to large positive-return days) especially when not accompanied by analyst forecasts.
Now why analyst earnings forecast/price target revision and not something else like buy/sell recommendations revision?
  • The study observes that there are about 10 times more earning forecast recommendation revisions and over 3 times more target price revisions than recommendation revisions. So using these will not omit too many signals.
  • Another reason is, say there is a big price increase and analyst already has a "buy" or "strong buy" recommendation, then there is no reason to revise that recommendation. On other hand, this price increase may cause analyst to revise either earnings forecast or target price forecast. 
Time for some stats...
Please find below some of the tables from the study heavily annotated with my comments...



 
Summary:
Overall the gist of the above tables is - one can forecast better the subsequent stock price returns after large price shocks if one takes into consideration whether there are immediate analysts revisions and are the revisions in the direction or opposite of price shock direction.

In the next part, I will cover the rest of the paper i.e., the portfolios constructed based on these insights and those portfolios performance. If you cannot wait till my next post, you can find the link to full paper here.

Question to readers:
I find this study interesting. On other hand, I am just a retail trader and neither know any analyst nor paid any attention in past to their output etc. So I am curious to hear thoughts from people who are more experienced on couple things like (a) does your experience correlate with observations in this study (b) why & how do funds/professionals in general use analyst revisions?

Updates to Wall Street Currents site...

As most readers of this blog know, Wall Street Currents site is my primary source of information to get a pulse on markets and for new ideas, view points & techniques to investigate. Over last week there were multiple changes to WSC site.

The changes were primarily in the following 3 areas of the site:
  • Front Page - Front page now includes articles from "Futures Magazine" and "Resource Investor" magazine. The latter is focused more on commodity side. You can find these under the left most column of front page. Few exclusions from the "Institutional Research" section.
  • Market Timing Page - Notable are the changes in the right  column. Real estate on any web page is a precious commodity. So though I want, I cannot allocate dedicated space for all blogs. If you feel strongly any particular blog requires its own space in right column over what we have now, then please let me know. Otherwise, I think the page now provides a good balance in providing new techniques/ideas, analysis and view points.
  • Quant Currents Page - This page has several exclusions and few inclusions. I notice typically 4 types of quant blogs - (a) blogs that provide interesting ideas, (b) blogs that follow quant herd i.e., running with whatever idea that is popular currently and add couple extra view points,  (c) blogs that are too theoretical  and (d) blogs that focus on quantity instead of quality. So most of the exclusions and inclusions are towards making the page concentrate on (a) and (b) category blogs. I am not yet done fully with pruning on this page. Now no process is perfect. So please feel free to suggest any changes.

Mobile Tip: 
If you are watching WSC site from a mobile (iPhone/iPad etc), double tapping with your finger on any box in WSC pages will cause the display to zoom in and fill the entire screen with that box for easier reading. If you double tap again, the display zooms out to show the entire page on the screen again.  
Share