Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

jswanson

Members
  • Content Count

    76
  • Joined

  • Last visited

Everything posted by jswanson

  1. I have a lot of Apple hardware. I run TradeStation 9.1 on my computers, natively. Remember, you can easily create a dual-boot computer. One partition you can run the latest window's OS and the other run the latest Mac OS. It's really simple and a great way to run TradeStation. I actually have dedicated Apple hardware just to run Windows so I can load TradeStation. I use macmini computers because they are so small. 7.7 inch square and 1.4 inches thin. They run TradeStation just fine. Mac Mini Apple - Mac mini
  2. Mike, A price proxy is a substitution for the closing price of the instrument. Often the closing price of the bar is used in the calculation of indicators, but in this case a proxy is used. That proxy is nothing more than a smoothed exponential moving average. When using a price proxy, don't even look at the closing bar. Instead use the value generated by your price proxy as the "close" price and base your trading decisions on this value. No retraces are required. Below is an example. In this example we have a simple moving average crossover system. However, there are two things going on. First, we want to go long when price closes above the upper band. Second, we are not using price! Notice there are several bars that close above the upper band but no position is opened. Instead we trigger our buy signal based on a price proxy. The price proxy is the yellow line. When the yellow line crosses above the upper band, we go long on the open of the next bar. This is a technique that reduces whipsaw. Hope this helps.
  3. There are many ways to use indicators to help determine when the market is within a bull or bear mode. A common method that works well on trending markets over the long term has been the so-called death cross and golden cross (Death/Golden Cross) indicator. Below are the rules used by the Death/Golden Cross to divide a market into a bullish or bearish mode. Bull Market = 50-Period SMA > 200-Period SMA Bear Market = 50-Period SMA < 200-Period SMA In short, the Golden Cross has been a great signal for long term market strength while the Death Cross often signals market weakness. Simply using the Death Cross as a signal to close all long positions within your retirement and brokerage accounts has historically saved your account from painful drawdowns. But can we improve upon this idea? Within this article I’m going to build upon the Death/Golden Cross concept. I recently became inspired to write this article after reading “Defining The Bull And The Bear” by Chuck Dukas. Chuck developed a simple and interesting method to take the Death/Golden Cross to the next level. I’m going to reconstruct his concept using EasyLanguage programming code and backtest it to see how effective it is. Within Chuck’s article, he uses a 200-period simple moving average (SMA) and 50-period SMA as the two primary indicators. These are the same indicators used by the Death/Golden Cross. However, where the Death/Golden Cross uses the crossing of these averages to generate their respective bull and bear signals, Chuck goes further by breaking up both the bear and bull markets into six different Phases. Recovery Phase Accumulation Phase Bull Phase Warning Phase Distribution Phase Bear Phase These phases take into account the relative positions of both the daily closing price and the two moving averages. This finer granularity can be used as a guide to deploy your money in the markets. Recovery Phase 50-Period SMA < 200-Period SMA Close < 200-Period SMA Close > 50-Period SMA Accumulation Phase 50-Period SMA < 200-Period SMA Close > 200-Period SMA Close > 50-Period SMA Bull Phase 50-Period SMA > 200-Period SMA Close > 200-Period SMA Close > 50-Period SMA Warning Phase 50-Period SMA > 200-Period SMA Close > 200-Period SMA Close < 50-Period SMA Distribution Phase 50-Period SMA > 200-Period SMA Close < 200-Period SMA Close < 50-Period SMA Bear Phase 50-Period SMA < 200-Period SMA Close < 200-Period SMA Close < 50-Period SMA The original article goes into much more explanation behind each phase but let’s stick with the basics which are very quantifiable. These simple rules can now be programmed into an automated trading system and tested. This system will be called the Market Phase System. For our examples I’m going to be buying the S&P 500 ETF (SPY) and deduct $30 per round trip for slippage and commissions. The system will be going long only and will scale into a position based upon the following rules: Buy 100 shares when we advance from Recovery Phase into Accumulation Phase. Buy 100 shares when we advance from Accumulation Phase to Bull Phase. At most we will hold 200 shares of SPY and we will exit our entire position when we enter Bear Phase. The exit rule is basically the same as the Death/Golden Cross. Also the entry rules are similar. The only difference is with the Market Phase System we are scaling into our 200 share position while the Death/Golden Cross purchases all 200 shares when the signal occurs. In short, the Market Phase System allows us to scale into our position during the Accumulation Phase instead of waiting until we transition into a Bull Phase. So, how do these two systems compare? Since the inception of SPY it has been difficult to beat following the Death/Golden Cross signals. The Market Phase System holds its own. It produces twice as many trades, but remember that’s also due to the fact it scales into the 200 share position. Please note, TradeStation reports each entry as an individual trade. That’s why we have over twice as many trades. But the system does hold up well. One tweak I would like to make to the Market Phase System is to substitute the closing price with a price proxy. As we know, the daily closing price of SPY can be rather choppy resulting in whipsaws. Let’s try to reduce some of these false signals and see if we can improve the system’s performance. For our price proxy let’s take the exponential average of the last five days. But don’t use the closing price of SPY. Let’s take an average of the daily high, daily low and the closing price. With this method we are taking into account the size (range) of the daily bar. Here is the formula. PriceProxy = Exponential Average ( (High+Low+Close)/3, 5 ) We will use the value of PriceProxy instead of the daily closing price in all our calculations. This is done to smooth out the short-term price noise. Below are the results. Does the scale-in technique of the Market Phase System perform better than our Death/Golden Cross system? It does! By entering 1/2 of our position during the Accumulation Phase we are getting on board the trend sooner and seem to be generating slight more net profit. Notice there are twice as many trades with the Market Phase System. Again, this is due to the fact we are scaling into the position. Both systems produce similar trading signals, but we get in earlier with the Market Phase System. Both the Market Phase System and the Death/Golden Cross system are long term trend following systems. They do OK on SPY because it’s such a broad based index. However, they don’t fair so well on major stock index ETFs such as NASDAQ, DIA or IWM. They also perform poorly when trading individual stocks. So, what else can we use these systems on? Commodity ETFs appear to be the best bet since they tend to have smoother trending characteristics which trend following systems can take advantage of. Note, many times a lot of cash is left on the table as we wait for the Bear Phase to close our long positions. Trading this type of system, which is typical for a long-term trend following system, one must have a lot of psychological strength to sit and watch profits evaporate while waiting for your exit signal. This is mentally difficult to do! This also makes me wonder if scaling out of the trades may work better to capture more profit. In closing, both of these systems are not tradable systems as they stand. For example, they do not utilize protective stops, take into account position sizing and money management. However, it appears they could provide a basis for a complete system with some modification. Download You can find the EasyLanguage code for the Market Phase Strategy here.
  4. Error on my part. That should read 6.5 hours. From 15:00 I include in the Post-Market period.
  5. The division of the market is largely arbitrary. In general, I tried to break the U.S. day session into the open session, lunch time session and end-of-day session. But there is nothing to stop you from testing larger or smaller intervals.
  6. The sample size may be significant or it may not. A rolling test over a longer period may be interesting as well so see if we can find any ebb and flow on how the market evolves. The 200 SMA has a lot of weight behind it. I've done numerous studies over the years that show the value of this MA. I don't think I posted any here however. No account for stationarity. Remember, this is not a trading system. It is a market study, one of many that may help to highlight important market characteristics.
  7. Those would be interesting as well. I'm simply providing a starting point...
  8. In this post I would like to explore the intra day action of the market to determine if we can find an edge. I'm going to be using the S&P E-mini futures market, but the principals here could be applied to any market. In particular, I'm interested how different times of the day affect different trading strategies. The trading day, as defined by the U.S. open and close, for the S&P is seven and a half hours. That translates to 390 minutes. When can thus break the day up into three 130-minute periods. Lets also explore the times before and after the regular day session. To do this we can add a 130-minute period before the market open (Pre-Market) and a 130-minute period after the market closes (Post-Market). We have broken a trading day into the following periods: Six Market Sessions Pre-Market, 06:20 - 08:30 The Open, 08:30 to 10:40 Midday, 10:40 to 13:50 The Close, 13:50 to 15:00 Post-Market, 15:00 to 17:10 Trend Following and Mean Reversion Now that we have these various times defined, I want to create a simple trading system to see if I can find an edge. The system should be very simple. I'm not looking to create a trading system but, I am attempting to locate clues as to what might work during a particular period. To keep this simple, I'm going to explore trades on the long side only and will be looking at the trading days between 1/1/2006 and 12/31/2011. In general terms, we can attempt to trade the market with either a trend following type strategy, or a mean reverting strategy. Trend following implies the market is moving in a direction and we expect it to continue. On the other hand, a mean reverting strategy means we expect the market to reverse soon, thus we position trade opposite of the current market direction. To determine which type of trading strategy would work better during these time periods I'm going to create two simple entry methods. For the trend following entry rule I will use the momentum calculation and open a long position if the momentum is above zero. For the mean reversion entry rule I will use a 9-period RSI and enter a long position when the value is below 25. The system will not have any stops. A single trade is entered and the position is closed at the end of the period. We are allowing only one trade per day. Slippage and commissions are not deducted. Trending System Entry = 12-period Momentum is greater than 0 Mean Reversion System Entry = 12-period RSI < 25 Market Mode Filter I often will make use of a market mode filter when I'm developing a trading system. This filter breaks the market into two distinct modes: bull or bear. We will use a 200-period simple moving average on a daily chart to determine if we are in a bull or bear market. A bear market is when price is below the 200-period moving average. A bull market is when price is above the moving average. Using this filter will limit our long trades to only be taken when price is trading above the 200-period moving average on a daily chart. In other words, we will be taking trades in the direction of the overall market trend. Bull Market = price > 200-daily simple moving average Testing Trend Following Characteristic BULL MARKET: I created an EasyLanguage strategy to first test the trend following characteristics of the five different periods. Below is a bar graph representing the net profit for each period. Period 1 starts on the left-hand side through period 5 on the far right-hand side. What this shows is during a bull market there is an edge with momentum trading during the Midday period and The Close period. This seems contradictory to what many may think. According to these results, momentum trades don't seem to do well during the morning. Instead they do better during the lunch time and at the end of the day. BEAR MARKET: Lets switch things up a bit. Lets now only take long signals during a bear market. In other words, we will now only take our long trades when price is trading below the 200-day SMA. This is opposite of the test we just performed above. It is also counter to the prevailing major market trend. Below is a bar graph representing the net profit for each period. This makes a huge difference. During a bear market there seems to be and edge for momentum trades during the last minutes of the trading day. How many times have you seen price rally into the close during a bear market? I've seen it many times and this study shows it. Both bull and bear market exhibit late day momentum bias to the up-side. This phenomena is even more pronounced during a bear market. Trying to build a trading system to exploit this edge may be worth investigating. Testing Mean Reversion Characteristic BULL MARKET: Now I will test using our mean-reversion trading system rules over the five different periods. Below is a bar graph representing the net profit for each period. The clear winner here is The Close period. BEAR MARKET: Now I will test using our mean-reversion trading system rules over the five different periods during a bear market. Below is a bar graph representing the net profit for each period. The clear winner here is the Pre-Market Period. Here we see our best edge can be found in the pre-market hours during a bear market. Below is a graph that combines all our results into a single image. Conclusions The graph below may look a little confusing at first. Focus one the bars above the zero line. That's what we are interested in since they show the most net profit. Ask yourself, which bars are the largest? If looking to create an intra-day trend following system there is one clear choice, locating an opportunity to go long during The Close period while within a bear market. It's seen as that large green bar during period four which almost hits $10,000. This conclusion seems counterintuitive but that's often the nature of the markets. For an intra-day mean-reversion strategy, a good place to start would be during the Pre-Market period while within a bear market. This can be seen with the large red bar during the first period. Also note how many bars are below the zero line. This suggests that shorting during the day may have a slight edge vs. going long. Is it not strange the two largest edges for both mean reversion and trend following strategies are going long during a bear market? How odd is that! Yet, it's not so strange when you take into account other studies. In fact, this article's strange conclusion is also supported by a previous study that demonstrates much of the points gained in the S&P market over the past 10 years have occur during the overnight session. In other words, the up-side edge during the day session is not overly strong. It seems we are seeing this over-night affect within this study as well. This is a rather simple study, but such studies can often point you in the right direction when gathering ideas on trading systems. Of course it is possible to discover a intra-day trend trading system that will do well. But this study is a great starting point on where to look for potential edges. In short we are asking, where might be the low hanging fruit? This type of study can also be applied to any other instrument. Likewise, we only explored longs during this study. Adding a shorting study would also help build a more complete picture. Other ideas could include, using different indicators for our trend following and mean reversion trading systems. Likewise, it would also be important to vary the look-back period for our indicators. We used a 12-period-look back for both indicators. By testing a range of values, say between 6-14, we can demonstrate the robustness of the edge.
  9. Both Frank Hassler and David Varadi create the TSI (Trend Strength Indicator). The TSI, as the name implies, measures the strength of a trend. In general, a higher TSI value means greater likelihood of continued trending behavior in the short term. On the other hand, a lower TSI indicates a greater possibility of mean reversion type behavior. Frank has used a TSI value of 1.65 or larger as the threshold for trending stocks. The formula for TSI is: TSI = Average( Average(Ratio,10), 100 ) Where: Ratio = Abs( Today’s Close – Close 10 Days Ago ) / 10-Day Average True Range {== START OF HEADER ========================================================================== Program: TSI Function Date: October 2011 Platform: EasyLanguage v9.0 DESCRIPTION: Ths function compute the Trend Strength (TSI) based upon a given Short lookback period and a long lookback period. A TSI score above 1.60 is often considered a strong trend. For more information see: http://www.systemtradersuccess.com == END OF HEADER ============================================================================= ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Copyright © 2009. Capital Evolution, LLC. All Rights Reserved. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ == DEFINE ALL INPUTS AND VARIABLES ==========================================================} Input: ShortLookback( NumericSimple ), LongLookback( NumericSimple ); Variables: Ratio(0); Ratio = AbsValue((close - close[shortLookback])) / AvgTrueRange( ShortLookback ); TSI = Average(Average(Ratio,ShortLookback),LongLookback); {== END OF MAIN PROGRAM ===================================================================== +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Copyright © 2009-2011. Capital Evolution, LLC. All Rights Reserved. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
  10. The Universal System is not much of a trading system. I've experimented with it. You have to optimize it for a market and timeframe, then re optimize every so often. I would say, don't waste your time.
  11. In this article I'm going to present another timing method that is 70% correct and consistently pulls money from both the S&P 500 market and the Mini DOW since 1997. The overall philosophy of the strategy will be to buy pullbacks within an uptrend and exit when price reaches a short term over bought level. The basis for the strategy can be found in a book called “Short Term Trading Strategies That Work” by Larry Connors and Ceasar Alvarez. Throughout the article I'm going to modify their basic strategy to take advantage of other trading techniques. Many trading systems and indicators generate their buy/sell signals from price. What this means, is a lot of people are looking at price. When it comes to making money in the stock market, if a lot of people are doing something, it can often be to your benefit to look elsewhere for answers! Thus, non-price based information can lead to powerful edges you can exploit. A common non-price based indicator is volume. Many traders will use volume or an indicator that uses volume to help make buy/sell decisions. Another is the put/call ratio which measures the number of open puts vs the number of open calls. In this article I'm going to look at the ARMS index. The ARMS index is more commonly known as the TRIN (Short-Term TRading INdex). The TRIN measures the bearishness or bullishness of a group of stocks. In this case all stocks on the NYSE. The calculation looks like this: TRIN = ( Advance Decline Ratio / Advance Decline Volume Ratio ) Where: Advance Decline Ratio = Advancing stocks / Declining Stocks Advance Decline Volume Ratio = Total Volume of Advancing Stocks / Total Volume of Declining Stocks ) Generally speaking a TRIN value below one demonstrates relative strength in the advance/decline ratio which is a more bullish market. On the other hand a TRIN value above one shows relative weakness in the advance/decline ratio which is more bearish in nature. The TRIN is below 1 when the AD Volume Ratio is greater than the AD Ratio and above 1 when the AD Volume Ratio is less than the AD Ratio. Low readings, below 1, show relative strength in the AD Volume Ratio. High readings, above 1, show relative weakness in the AD Volume Ratio. In general, strong market advances are accompanied by relatively low TRIN readings. As you can see the TRIN value is inverse to the price of a rising index such as the NYSE. Let's get down to business to creating our strategy. We’ll use a trend filter to define the overall market mode (bullish or bearish). We'll do this by using a 200-day simple moving average (SMA). When price is above its 200-day moving average the market is in bullish mode. In our example strategy we will be going long only. For timing our entry we are going to use two indicators. Our first indicator is our battle tested 2-period RSI which must be below 50, which indicates some short-term price weakness. Our next indicator is the NYSE TRIN index. This indicator must close above 1.00 for three consecutive days. An elevated TRIN index shows sustained bearish pressure on price. Coupling these two bearish indicators together produces our buy signal. When we buy into weakness in an overall bullish market and exiting our position upon short-term market strength we are capitalizing on an over stock index edge that has been holding strong for over a decade. Furthermore, what's nice about this particular setup is we have two indicators confirming our entry point. One is price based (RSI) and the other is non-price based (TRIN). So, we are getting confirmation from two independent sources. We open our position at the open of the next day. (should we try at the close of the day?) Our exit is even more simple than our entry rules. Once a position is opened we simply exit the trade at the close of the day if the daily 2-period RSI reads above 65. Long-Only System Rules Price must be above its 200-day moving average. The RSI(2) of the market must be below 50. The TRIN must close above 1.00 for three consecutive days. Enter at Open of the next trading day. Exit when RSI(2) of the market closes above 65. Exit at the Close of the current trading day. I coded these rules in EasyLanguage and tested it on the S&P E-Mini futures market. A total of $30 per round trip was deducted for commissions and slippage. Long Only Equity Curve Looking at the trading rules, you can see the Long-Only System has a market mode filter (the 200-day SMA) to identify the overall bullishness or bearishness of the market. But we make no distinction between a strong trending bull market and a weak trending bull market. If we are in a strong bullish market it makes sense to hold on to our trade in an attempt to capture a bigger move. On the other hand, if we are not in a strong trending market we may want to exit our long position rather quickly. Yet, our Long-Only System always sells when a 2-period RSI rises above 65. The exit makes no adjustment for the trendiness of the market. Buying In A Bear Market The Long-Only system only takes trades during a bull market. During a bear market we simply sit on the sidelines in cash. But bear markets present opportunities as well. Let's add another buying rule to open new positions during a bear market. Based upon past market studies we can make an important assumption in regards to how price behaves during a bear market. Most notably, the market can experience much deeper and stronger sell-offs. Thus when we are looking for an entry signal, we will want to see our RSI value be much lower than the value used during a bull market. During a bull market we are simply looking for the RSI value to be below 50. In a bear market we will want the RSI value to be below 10. Our new bear market entry rules look like this: Price must be below its 200-day moving average. The RSI(2) of the market must be below 10. The TRIN must close above 1.00 for three consecutive days. Enter at Open of the next trading day. Exit when RSI(2) of the market closes above 65. Exit at the Close of the current trading day. Long/Short Equity Curve Long/Short Performance In Summary The trading concept presented in this article is a great example of using both a price based indicator along with a non-price based indicator as an entry signal. The system, as is, appears to be very solid. Please remember, this is not a complete trading system. For example, there are no stops or money management rules. However, it's a great starting point from which you can build your own trading system. Download You can download a copy of the EasyLanguage code as a text file here.
  12. While I did not test intra-day I will say this: my experience tells me that intra day with such a strategy will not work. In short, the smaller the timeframe the more noise there is.
  13. In this article I'm going to demonstrate a technique to help adapt your trading systems to the changing market conditions. In a previous article entitled, Trend Testing Indicators for Adaptive Trading Systems, I tested several indicators that could be used to divide the market into two modes: bullish and bearish. These two modes were then used to dictate how the trading system should execute its trades. For example, during a bull mode only open long trades. During a bear mode only open short trades. In essence we made our system adapt to the given market conditions. However, we can take this concept further by looking at a different market characteristic: trend strength. A market may be in a bull mode, but how strong is the trend? Is the market rising fast or is it range bound? We would like to know if the market is trending strong or not because we would like to trade them differently. It's clear a range bound market should be traded differently than a trending market. In general you may want to hold an open position longer if the trend is strong. By measuring the strength of the trend we can further divide the market to make our trading system more adaptive. By introducing trend strength we now create four distinct market environments that can be used to determine how an automated system trades. THE BASELINE SYSTEM For the by and sell signal I’m going to borrow what is known as the Cumulative RSI Strategy from the book, ”Short Term Trading Strategies That Work” by Larry Connors and Ceasar Alvarez. The system only goes long. There is no shorting. This strategy goes long the S&P 500 E-mini when the market experiences a pullback in a long-term uptrend. A long-term uptrend is defined by our familiar 200-day simple moving average. We will also be using a 2-period RSI to locate high probability entry points, but with a slight twist. Instead of a single calculation we will be computing a running daily total of the 2-period RSI. In this case, the total of the 2-period RSI for the past three days. We exit the trade when the 2-period RSI rises above 65 . The rules are: * Price must be above its 200-day moving average * Buy on close when cumulative RSI(2) of the past three days is below 45 * Exit when RSI(2) of the close of current day is above 65 This system is applied to a daily bar chart going back to 1997 with$ $26 deducted from each trade. Looking at the chart the equity graph looks great up until the very end! That’s when the sudden market drop occurred this summer (2011). Remember, the strategy code has no stops. Overall, these rules do a fine job of trading the S&P E-mini. Looking at the trading rules, you can see the Baseline System has a market mode filter (the 200-day SMA) to identify the overall bullishness or bearishness of the market. But we make no distinction between a strong trending bull market and weak trending bull market. If we are in a strong bullish market it makes sense to hold on to our trade in an attempt to capture a bigger move. On the other hand, if we are not in a strong trending market we may want to exit our long position rather quickly. Yet, our Baseline System always sells when a 2-period RSI rises above 65. The exit makes no adjustment for the trendiness of the market. INTRODUCING TREND STRENGTH Let’s use TSI to gage the trend strength of the market and define a strong trend as >= 1.5 and a weak trend as < 1.5. These are not optimized numbers. They are simply a generalization from experience. Now, let’s modify our exit parameter to hold longer during a strong trend. We’ll exit when a 5-period RSI rises above 65. By increasing the period of the RSI calculation we required price to move further from out entry before triggering our exit. This should allow us to hold our position longer and capture more profit during a strong trend. Our new bull market exit rules look like… If TSI >= 1.5 Exit when RSI(5) of the close of current day is above 65 Else Exit when RSI(2) of the close of current day is above 65. By introducing a simple trend strength indicator and holding our long position a little longer when the trend is strong we generate more net profit and more profit per trade. We also reduce the number of trades. This is a good improvement and demonstrates we are on the right track by holding our position longer during a strong trend. GOING LONG DURING A BEAR MARKET What can we do during the bear mode? Bear markets tend to have very sharp, dramatic down days. These can often be followed by violent short-covering rallies. It makes sense that if we want to find a buying opportunity we must be a bit more choosy on our entry. We can accomplish this by requiring price to be VERY oversold by reducing the cumulative RSI(2) value to be below 20. I just basically took the default value of 45 and cut it in half. We’ll use the Baseline System’s exit rule to exit quickly since we are in a bear market. Bear market entry rule… Buy on close when cumulative RSI(2) of the past three days is below 25. There you have it. A system that adapts to several different market conditions. I did not cover the non-trending side of the bear market, but you are certainly free to explore that. Likewise, you can expand this concept to create an automated system that actually changes its trading behavior based on which of the four market environments we defined. Maybe a mean reversion system vs a long term trend following system. You can also try different indicators for measuring trend strength of market mode. You can download the strategy code for the final system here (text file). If you are not familiar with the TSI indicator, you can learn about it and download the code here.
  14. That's correct. My mistake! One program I wrote actually does enter in the night session at around 3:15 central. Orders (buy and protective stops) can be executed automatically or sent to the execution severs of my broker. Thus, I can sleep while my trades are being executed.
  15. Thanks Ziggie. Glad you find them useful. I have many more studies that I will be posting. As for your question, I used the "regular" session from 8:30 to 4:15 Central. Yes, options can be a way to hedge against those black swans. Of course the futures market is open in the overnight session and you have a good chance of getting stopped out - which is good. However, holding from Friday to Sunday night might require options as well.
  16. Let's take a look at a simple moving average crossover system and see if we can improve it. Specifically, can we improve the moving average system's performance by reducing the number of whipsaws during those dreaded range bound markets? Whipsaws occur when a market moves from a trending mode to a consolidation mode. During this consolidation mode the system gets whipsawed from long to short creating a string of losing trades. Long trades suddenly reverse hitting your stop. Likewise for short trades. These 'false signals' can destroy your equity curve. In this article I'm going to present two simple methods to improve the simple moving average crossover system. These ideas can easily be implemented into your trading systems and may provide a great starting point for a trend following system. Baseline System Our baseline system will consist of two simple moving averages (SMA) executed on a daily chart of the Euro futures. I'm picking the Euro because it has demonstrated solid trending characteristics as opposed to the stock index markets which tend to be mean reverting. If you will recall, signals are generated when a faster moving average (trigger SMA or trigger line) crosses a slower moving average (slow SMA or slow line). Slow SMA 50 period Trigger SMA 3 period Go Long when trigger crosses above Slow SMA Go Short when trigger crosses under Slow SMA Dates Tested: May 2001 - September 30, 2011 Commissions & Slippage: $26 deducted per trade Number of Contracts: 1 For those using TradeStation the Baseline System was created by inserting two strategies into the chart that were provided by TradeStation. Below are the two strategies. The first one controls the long entry (LE) rules and the second one controls the short entry (SE) rules. You can see the input fields contain the three and the fifty for the two different periods for our moving averages. Buy using these provided strategies you can build a moving average crossover strategy within seconds without any coding skills. BASELINE SYSTEM EQUITY CURVE These two simple rules produce a trading system that is actually profitable over the long term. This is a testimate to the trending characteristics of the Euro futures market. However, there are periods of large drawdowns and long periods where no new equity highs are created. It’s not likely anyone would actually trade this. The image below shows a recent period from 2011 when the Euro entered a consolidation phase during the summer months of June through August. During this time our Baseline System produced a string of eight consecutive losing trades. WHIPSAW SUMMER 2011 IMPROVEMENT #1: DELAYED ENTRY With this entry method we are going to delay our entry into the market after the trigger line crosses the slow SMA. So, when the trigger line crosses the slow SMA we do not open our position right away. We delay for several bars. Let’s say we wait for 10 bars after the cross occurs. On the tenth bar after the signal we see if price is still above the slow SMA (for a long entry) and enter at the open of the 11th. If price is below our slow SMA we don’t open a new position. By doing this we eliminate some whipsaws at the expense of entering the trade later than the original SMA cross. The idea behind this method is if a new bull market is about to start, price should not fall back below the slow SMA. In short, it’s another way to measure the amount of conviction for the next market phase. However, we will keep the exit the same. When an EMA cross occurs we always close our open position. We only apply the delay when opening a new position. The equity curve with our delayed entry actually moves the entire equity curve above the zero line. Fewer trades are taken and we reduce the total net profit. The equity curve also appears a little less jagged implying a slightly more smoother climb up. Below is an image showing the whipsaw summer time period in 2011. You will notice we have reduced the number of whipsaws from eight to five. Just during these few months we reduced the number of false entries by three. WHIPSAW SUMMER 2011 IMPROVEMENT #2: TRADING BANDS Unlike the standard moving average crossover where the trigger line must simply cross the slow SMA, our trigger line must now demonstrate conviction by crossing beyond the slow SMA. For example, picture another band above the slow SMA that is 1 ATR above the slow SMA. In order to open a new long position we require the trigger line to penetrate that ATR band above the slow line. Now picture another band that is one ATR below the SMA. This band represents our short trigger when we open a short position. We hope to eliminate some whipsaws by delaying our entry and forcing the market to show us some strength. Some of you may have already noticed that what we have is a Keltner Channel. A Keltner Channel is nothing more than a moving average (slow SMA) with an upper band X number of ATRs above and below the slow SMA. The upper and lower bands act as the trigger to enter either a long position or a short position. The bands adapt to expanding volatility requiring more price conviction to initiate a new position. Likewise, these bands contract during lower volatility times. Thus, the entry and exit rules are more dynamic to a changing market than a simple moving average crossover. The equity graph does not look too much different than our 10-bar delayed entry system. The entire equity curve is shifted a little closer to the zero line and it appears there are fewer trades. Below is the same time period showing the Band System has reduced the number of false signals from eight to two. This is a great improvement over the Baseline System. WHIPSAW SUMMER 2011 SUMMARY Each of the two methods improved the results of the original Baseline System. Looking at the graph below we can see performance statistics such as profit factor, percent winners and average trade net profit all increased. The Band Entry produced the best overall statistics. However, the maximum drawdown did not change much. We certainly don’t have a trading system that is tradable with real money, but we accomplished our mission. We reduced the number of whipsaws with our Delayed Entry System and Band Entry System. You can see this by looking at the number of trades taken by each system and the percent winning trades. Code Download The band trading system is rather simple, but the delayed entry is a bit more tricky. If you would like a copy of the EasyLanguage code (text file) you can download it here.
  17. For those interested in the EasyLanguage code used during this study, you can download it here.
  18. Often when designing a system it’s important to keep the big picture in mind. What is the overall market doing? The most simple way to accomplish this is to break the market into two modes: bullish or bearish. We are all aware that price action is a mirror of human psychology therefore price action is different between these two modes. Sudden market plunges that we see within strong bear markets, such as in 2008, behave much differently when contrasted to the continual grinding, upward market we saw in late 2009 and 2010. People behave differently under fear (how low can it go) and pain (look all the money I lost) vs. doubt (this can’t be going higher) and greed (I’ll just make a bit more before I exit). Since people behave differently under these two market modes it makes sense that we should design trading systems that take advantage of the different market characteristics for each mode. We want to build a system that dynamically adjusts its trading parameters based upon which market mode we are experiencing. To do this we can use an indicator. The most simple way to divide the market is to use a 200-period simple moving average (SMA). When price is above it we are in a bull mode. When price is below it, we are in a bear mode. This simple concept can improve many trading systems. I’ve personally used this technique many times. Yet there are other techniques to divide a market and some of these might produce better results than our old reliable 200-day SMA. In this article I want to take a look at a few different methods and test them on several markets. The indicators we are going to test are: SMA(140) Rate of Change (ROC) Smoothed Adaptive Momentum Relative Strength Ranking (RS Rank) The Smoothed Adaptive Momentum and Relative Strength Ranking are two indicators you may not be aware of. First, the Smoothed Adaptive Momentum was created by John Ehlers. It’s a complex indicator and more then I want to get into during this article. Google it if you wish and you can also find the EasyLanguage code here. As for the RS Rank, you can find more about here. I will say this about the RS Rank for now, traditionally it’s used as a ranking tool to compare a group of stocks or ETFs to determine which specific instrument is performing best. As its name implies, it ranks each instrument based on how well the instrument has been performing. You can then compare this score to the other stocks or ETFs in your basket of trading instruments. Thus, you can simply pick the instrument with the highest RS Rank score when creating a momentum based trading system. In this article I’m using it for a completely different purpose and was curious on how well it would hold up. We are going to use a 140 day period for all our examples. 140 days represents about seven months of trading if you figure there are about 20 trading days per month. This is not a magic number by any means. I was first going to pick 120 days because this represents half a year. However, it seemed too obvious a choice so I pushed it back to seven months. I did not want to pick a smaller number than six months because I don’t want the buy/sell signals to occur very often. The idea is capture the long term market mode, not every market gyration. I did not want to look at 200 either. I wanted to do something a little different. Maybe we can find something more responsive than a 200-day SMA. Of course I encourage you to perform your own testing as well. The strategy code to test the effectiveness of these different indicators is rather simple. We are only going long during a bull market and closing our position when that bull market switches to a bear market. In essence we are creating a very simple trend following system. For each indicator the transition is based upon: SMA: Bull market when price is above the SMA ROC: Bull market when indicator value is above zero Smoothed Adaptive Momentum: Bull market when indicator value is above zero RS Ranking: Bull market when indicator value is above zero First I will take a look at the SPY ETF. S&P 500 ETF (SPY) FROM 1993 – 2011 The chart above compares our four different methods vs. some common system performance metrics such as profit factor and average net profit. The bar graph specifically compares each system’s profit factor score. Here we can see the RS Rank has clearly performed better at distinguishing between a bull or bear mode. The ETF history is not very extensive, so let’s take a look at the cash index, which goes back to 1960, and see what the results look like. S&P 500 INDEX (SPX) FROM 1960 – 2011 Here we can see even going back to 1960 on the S&P 500 cash index that RS Rank does a nice job. What about the futures market? Let”s look at the S&P E-mini. S&P 500 E-MINI (ES) FROM 1998 – 2011 Now we see a huge difference from the previous two markets. Notice all the profit factors are below 1. This means the strategy performance produces a loss. On the ETF and Cash index all indicators produce a positive result. What’s going on? The futures market is a different beast. The trending characteristics of the S&P E-mini market is very weak. In fact, much has been written about the mean reversion characteristics of the S&P 500 E-mini index futures market. Our study is simply confirming this fact. Based upon what we know now, if you were going to design a trading system to trade the S&P 500 ETF it appears using the RS Rank would be a good choice. On the other hand, if you were going to use the E-mini as your market you might want to use the SMA. This is in fact what is done with our Aurora trading system. While the SMA does not perform well as a trading system, it does do a good job of breaking the market into the two bullish or bearish modes. Often you will see increased performance in your trading systems by utilizing a SMA filter for the E-mini. Let’s look at a different market. The Euro currency market. First up is the ETF. EURO CURRENCY ETF (FXE) FROM 2006 – 2011 We don’t have much historical data to look at, so these results don’t mean a whole lot. However, they do appear consistent with our results from the S&P 500 ETF results. There appears to be one clear winner: RS Rank. We have more historical data on the futures market so, let’s look at that. EURO CURRENCY FUTURES (EC) FROM 2001 – 2011 The above bar graph is the same as the Euro ETF! From the graph above we can see the futures market for the Euro has solid trending characteristics. We also see, once again, RS Rank shines. However, the number of trades is low, but do we see a pattern? Based on these limited tests RS Rank show superior results when determining a bull market from a bear market. The exception is the S&P 500 E-mini. In the case of the S&P 500 E-mini a simple moving average appears to be the better indicator. I would imagine similar results would be found between the DOW futures vs the DOW ETF. In summary, put this to use in your own efforts at building a trading system. Use an indicator to determine the market mode and trade accordingly. The point here is to have your automated trading system automatically adapt to a changing market. For example, when the market is bullish you may want to look for longs only while ignoring shorting opportunities. Or if the market is within a bearish mode the criteria for entering a long position might be stricter than when in a bull market. Too often people simply trade the same setup or method during different market conditions. By breaking the market up into two modes, you are making your trading system dynamic and adaptive to the changing market. There are ways to segment a market further. In a future post I will discuss how to segment a market into four distinct modes. Each of these four modes can be used to further adapt your trading system.
  19. Thanks. The entry/exit was simply when the 50-period SMA crosses the 200-period SMA.
  20. In mid-August of this year (2011) there were many people pointing out the newly formed “Death Cross” in the major indices. The Death Cross is simply when a 50-period simple moving average (SMA) crosses under a 200-period SMA on a daily chart. Such a signal is believed to warn of upcoming bearish market activity. The opposite signal is called a “Golden Cross” and is alleged to warn of bullish market activity. But does the Death Cross or the Golden Cross hold any merit? What can we learn from these signals and how can we use this information in our trading? In this article I’m going to demonstrate why the Death Cross is important and why its opposite signal, the Golden Cross, may be even more important. Both the 50-period SMA and the 200-period SMA are well known moving averages. Thus a lot of eyes are watching price around these levels. It’s no surprise when these moving averages cross the event might be worth noting. One way to test how well the Death Cross and Golden Cross perform historically is to create a simple trading system based upon these signals. Using TradeStation’s EasyLanguage coding language it’s simple to create a trading system that is always in the market switching between a long position and a short position based upon a moving average crossover. Here is what the entire trading system code looks like: if ( Average(Close,50) crosses above Average(Close,200) ) then buy(“Golden Cross”) next bar at open; if ( Average(Close,50) crosses under Average(Close,200) ) then Sell short(“Death Cross”) next bar at open; In order to get a long-term feel for this system I’m going to use the S&P500 index going back to 1961. The trading system will have an initial trading account size of $20,000. To keep the position sizing simple each signal will use $10,000 to determine the number of shares to purchase. By dedicating $10,000 to each trade we are attempting to normalize the number of shares we purchase based upon the cost per share. Back in the 1960s one share was around $70 while today it’s worth over $1,000. Next, I opened a chart with daily data for the S&P E-mini from 1961 to September 30, 2011. I then applied the strategy to the chart while making no deductions for commissions and slippage. Before we start looking at some of the numbers I want to break this study into two parts: Shorting a Death Cross vs. going long the Golden Cross. What interests me is how well the system functions going long vs going short. In other words, what does the SMA cross tell us about a bearish cross vs a bullish cross? Are they different? Since we recently experienced a Death Cross, let’s first look at shorting every Death Cross signal. The equity graph is below and it’s not pretty. SHORTING THE DEATH CROSS What does this tell us? To simply short the Death Cross may not be very profitable. We can see the equity curve hangs around the zero line for decades. In recent times it has climbed from negative territory to just below the zero line. Yet, there is nothing in this picture that suggests we have an edge simply shorting the S&P index upon a Death Cross signal. Maybe we should be taking the Death Cross as a buying opportunity? Why not? We want to be opposite the crowd, right? Below is the equity graph when we go-long at every Death Cross. GOING LONG THE DEATH CROSS Interesting! At times going long actually makes money and notice how the equity graph spends a lot of its time above the zero line. Furthermore, unlike shorting the Death Cross, going long actually produces a positive result. Counter intuitive to common knowledge, I would say. Yet, it’s not much of a profit for all those years of trading and it’s certainly not an edge we can take advantage of. All in all this strategy is a wash much like shorting the Death Cross. This graph probably reflects the fact that the S&P 500 has had a bullish bias since 1961. It also points to the idea that during a Death Cross we have continued market weakness. In other words, market gains are not likely to happen when the 50-period SMA is below the 200-day SMA. Next let’s look at taking every long signal. The equity graph below depicts going long at each Golden Cross. GOING LONG THE GOLDEN CROSS This is a much improved equity graph! We seem to have a clear edge going long the S&P 500 when a Golden Cross is triggered. This graph highlights the fact that when the 50-period SMA is above the 200-day SMA the market often exhibits bullish behavior. Combining what we have now learned I would say our two equity graphs above might be suggesting moving your investing accounts into cash when a Death Cross forms may be a good idea. This would be done in my opinion to prevent drawdown and thus avoid the pain seeing your profits evaporate. It’s certainly can be much more psychologically appealing to be in cash when those big bear markets hit. Shorting a Death Cross does not have much of an edge and only after a Golden Cross does the market hold a strong bullish edge. The chart below shows each trading system with the addition of a buy-and-hold approach. You can see the market has had a clear up-side bias since 1960 and buying and holding produced the best annualized return. But at what cost? The drawdowns you must live through can be substantial! The maximum intra-day drawdown, expressed, in terms of your initial capital is 777%. While buy and hold has worked wonders if you started in 1961 it has not done well over the past 15 years. Over the past 15 years the buy and hold has returned a zero annualized return while the long-Golden Cross has returned around 2% annual return over the same period. But the advantages and disadvantages of buy-and-hold are for another topic. SUMMARY: By comparing the market behavior during a Death Cross vs a Golden Cross we can come to some generalizations that might help in both your investing accounts as well as your trading accounts (depending upon your timeframe). * Upon a Death Cross signal the market shows general weakness to the upside. This weakness can be difficult to short. Moving into cash during this time may prevent you from experiencing significant drawdowns. Remember, we are not talking about day trading in this article. The Death Cross and Golden Cross are based on slow moving averages that work best for long term holding periods. A skilled day trader can make a lot of money shorting during a bear market, of course. However, when it comes to using a slow timing method such as the Death Cross, it does not seem to pay off. * Upon a Golden Cross signal the market has demonstrated a lot of bullish activity. This one is easy. When a Golden Cross occurs, going long the market may lead to strong gains over the coming months and years.
  21. Here is a simple automated system that might spark some ideas on creating a complete trading system of your own. It's called the VIX Stretch Strategy and was found in a book called “Short Term Trading Strategies That Work” by Larry Connors and Ceasar Alvarez. The concept is executed on a daily chart of the S&P E-mini futures market and the rules are very simple. 1) Price must be above its 200-day moving average 2) VIX must be stretched 5% or more above its 10-day moving average for 3 or more days 3) Exit when 2-period RSI crosses over 65 Simple yes, but also powerful. A 200-day simple moving average (SMA) acts as a simple market environment filter by dividing the market into two major mode: bullish and bearish. Since the strategy only goes long, trades are initiated if the closing price is above the 200-day SMA filter. The next rule utilizes the VIX which is a measure of the implied volatility of the S&P 500 index options. This is sometimes called the fear index. Why? You will see this index climb dramatically when the market sharply falls and market participants become fearful. Thus, spikes in the VIX index are often associated with steep or dramatic market selling. Since we are looking for a market downturn to open a long trade when we are within a longer term bullish trend, we use the VIX index to gauge the market downturn. Buying the dips within an overall bull market is a classic trading setup. It’s also interesting to note we are not simply using price action to gauge a market downturn. By using VIX to gauge the level of the market downturn we are measuring the increasing volatility seen in the S&P 500 index option prices. Thus we are not measuring a pullback in price directly, but indirectly. The final rule is our exit rule which uses a 2-period RSI. Upon the close of the daily bar the RSI is calculated and if this value is above 65 we exit at the close. I coded these rules in EasyLanguage to see how well they would perform. It did rather well. The results below are from 1997 through March 2011 (which was the last time I ran the results). $20 for slippage and commissions was deducted per round trip. The code I used to generate the results is available here as an easy language text file.Is this a complete trading system? Nope. Please note the code used to generate these results has no stops! Most people would consider this a complete violation of the rules. I myself would not trade without stops. So a catastrophic hard stop may be added. The code has a input field to enter a stop. In closing this timing strategy is a great seed idea for building a complete trading system. With a little creativity I’m sure you could turn this into a great system.
  22. Here are some graphs displaying the same study with two ETFs and Apple stock. This overnight edge clearly does not exist for the S&P E-mini futures market only. The Euro ETF example is interesting because it seems to show no significant difference between the two periods. Apple Day Gains Apple Night Gains Euro ETF Day Gains Euro ETF Night Gains Gold ETF Day Gains Gold ETF Night Gains
  23. This is true. I do have as bias as I trade from America and I'm human thus imperfect. I'm not sure why you would be offended such things. As an American I trade the American hours since that's when I'm awake. I could run the tests on other markets throughout the world. However, I only study the markets that I trade during the hours I trade. I put this study up as a courtesy. I have many studies like this that aid in my developing trading strategies and I thought I would share. Thanks for writing.
  24. This study was done the S&P E-mini futures contract which trades in the over night session.
  25. When do you think the most points are accumulated in the S&P E-mini market? During the day session or during the overnight session? To answer this question I developed two simple strategies. Both strategies only go long. They both use a daily chart and a 200-period simple moving average (SMA) as a market environment filter so trades are only taken when price closes above the SMA. Both systems were executed from 1997 to September 2011 with no slippage or commission cost deducted. The Day's Session The first strategy simply buys at the day's open and closes the position at the end of the day. Thus we are capturing the points gained or lost during the day session. The equity curve is a sum of the points gained or lost during the day session since 1997. Below is the equity curve of this trading system. The Night Session The night session strategy is just as simple but it opens a new position at the close of the daily bar. It then closes that position at the open of the next bar. Thus we are capturing the points gained or lost during the night session. The equity curve is a sum of the points gained or lost during the night session since 1997. Below is the equity curve of this trading system. As you can see there is a clear difference between the night session and the day session. What does this mean to you? There does seem to be an edge in exploiting long positions by riding the overnight session. My hypothesis is because so many active traders do not trade the overnight session, the market will often move in such a way as to lock them out from gains. Most people are familiar with the market shakeouts that rattle the faith of bullish participants, thus forcing them to lose their position. You've seen it where the market moves down to takeout your stop only to reverse in your favor. A painful experience. However, the market does have another subtle trick that messes with your psychology. That trick is making you miss the bull move all together. Yes, the markets are good at trapping you out of a move too! Anyway, keep this night vs. day session study in mind and perhaps you can use it to help gain an edge with your trading.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.