System Trader Success
Share It!

Higher Time Frame Stops Strategy Tool

This article deals with a tool to help you test various stops when building trading systems in TradeStation’s EasyLanguage. This topic is really a part 2 of the article, “Advanced Stops and Targets Strategy Tool“. In the original article the created tool called _Stops&TargetsAdvanced is a simple strategy based on an existing TradeStation strategy called  _Stops&Targets. I took this program and modified it with several other exit techniques and made it available.

The original _Stops&TargetsAdvanced strategy tool could be applied to any strategy you’re working on to aid in testing various stops. With this tool you can quickly test several popular stops without writing any code. The stops were all based upon the same time frame you were currently trading. In TradeStation lingo, that’s your data1 feed. However, what if you wanted to base your stops on a different time frame? In this article I’ve created a modified strategy tool that will help you test various stops on a different time frame.

I created a new strategy tool called _Stops Higher Time Frame which takes data from a different data stream other than the instrument you’re trading. Most of the time, this second data stream will be data2. This will allow you to generate stop values from a different time frame from the one you are trading on. For example, if you’re trading the S&P eMini on a 5-minute chart you can now test various stops on a 30-minute time frame or any other time frame. However, the data stream number is actually controlled by an input value. Thus, it’s possible to take signals from data3data4, or whatever you like. This provides you with the flexibility of controlling exactly what data stream your stop values will be generated from.

Below is an image of the _Stops Higher Time Frame strategy applied to a chart. You can see this strategy is running parallel with another strategy called RSI2 Simple which uses a two-period RSI to generate buy signals when price closes below the value five. All exit signals are generated by the _Stops Higher Time Frame strategy.

Insert_Into_Chart

Because the new strategy tool generates stop values from a higher time frame, you will need to have Data2 defined within your trading chart. This is simply done by importing a new symbol into your existing chart and selecting the Data2 option.

Format_Symbol

 

If you’re not familiar with adding a second symbol into a single chart or not sure how to use EasyLanguage to take advantage of a second data stream, I would urge you to pick up a copy of this free report, “Access Two Timeframes In EasyLanguage“.

Types of Stops

There are a total of eight different stops you can test. They are listed below. Of course, there is nothing stopping you from adding additional stops to this strategy tool. The code is freely available for you to download and modify at the bottom of this article.

  1. Bar Count Exit – Exit a position based on the number of bars since the position was opened.
  2. ATR Hard Stop – Exit a position based on the average true range of the market. This is a fixed stop loss. In other words, the stop does not advance as a position moves in your favor. However, the value of the stop loss is updated on each bar close to adjust for the current market ATR.
  3. ATR Trail – Trailing stop based on the average true range of the market.
  4. Square Root ATR Trail – This simply takes the square root of the ATR value. What this does is reduce the variablility of each reading. You can read more here.
  5. Noise Tolerant Stop – This technique is based upon the article, “A Noise Tolerant Money Management Stop“, and provides a linear regression-based stop which is also a non-optimized-based exit.
  6. Moving Average Exit – Exit a position based upon when price crosses beyond a simple moving average.
  7. RSI Exit – Exit a position based on an RSI value.
  8. Day Of Week Exit – Exit a position based upon the day of the week. By using this stop you can close all positions on a specific weekday, such as Friday.

Input Values Explained

Next I will explain the input values.

  1. ShareOrPosition –  Should P&L be calculated based on per share or position bases.
  2. DataNum – This is where data stream takes signals from. In most instances the value will be 2 indicating data2.
  3. ExitToTest – This indicates which stop to test. At the time of this writing there are eight stops to test. Simply enter the digit (see above, Types of Stops) of the stop to activate.
  4. NumBars – The number of bars to exit a position since opening the trade.
  5. ATRLen – The number of bars to use in ATR calculation.
  6. ATRMult – This number is the ATR multiple. The value is multiplied by the ATR to generate a final value.
  7. NTStop_N – The look-back period for the noise tolerant stop.
  8. MALen – The look-back period to use for the moving average-based exit.
  9. RSILen – The look-back period to use for the RSI-based exit.
  10. iDayOfWeek – The day of week to exit. 1 for Monday and 5 for Friday.

Exiting Based on A Different Instrument

I originally created this strategy tool to be used on a higher time frame. However, there is nothing stopping you from using a different instrument to trigger your exits. Since signals to exit are being generated on a different data stream that the instrument you’re trading, that means you really could use anything. For example, instead of exiting  your Apple shares on a daily chart, you exit when the QQQ fall below a moving average. So, using this tool opens up the possibilities beyond different time frames.

Closing

I would suggest reviewing the first article in this series, “Advanced Stops and Targets Strategy Tool“. On that page you will find video instructions on the original stops and targets tool which will go a long way in helping you here. Overall, this is a very simple strategy tool which can be rather helpful. The _Stops Higher Time Frame strategy tool is really a framework from which you can add your own stops.

Download

The stops strategy tool is available as a free download.

Higher Time Frame WorkSpace (TSW File)
Higher Time Frame Stops Strategy Tool (ELD File)
Higher Time Frame Stops Strategy Tool (Text File)

About the Author Jeff Swanson

Jeff is the founder of System Trader Success - a website and mission to empowering the retail trader with the proper knowledge and tools to become a profitable trader the world of quantitative/automated trading.

follow me on:

Leave a Comment:

7 comments
Add Your Reply