What's New

Cumulative Tick

I finally had some time to start reading my copy of Michael Gutmann’s The Very Latest E-Mini Trading, 2nd Edition: Using Market Anticipation to Trade Electronic Futures. I’ve enjoyed the book thus far and have created a few new indicators as a result. The first is the Cumulative Tick indicator as shown below. This study is designed to run on a 20 day, 5 minute chart of one of the primary futures contracts (/ES, /YM, /TF, /NQ). Each day, the indicator plots the cumulative sum of the NYSE $TICK values. Gutmann uses this chart to determine the type of trading day evolving. The last two days are considered “Unequivocal Trend Days.” The horizontal lines on the indicator represent average values of the cumulative tick at 10:30, 12:00, 13:30, and 15:00 EST. There are separate averages for days with a positive closing cumulative tick and a negative one. By comparing today’s value to the average lines at a given time one can get a sense of the strength of the day’s trend in relation to the historical average. Ideally, we would like to calculate the average value lines over a larger time period than 20 days and a smaller interval than 5 minutes. Gutmann uses a 100 day 1 minute chart for his calculations. Unfortunately, I found the best we could get with TOS was 20 day 5 minute. I’ve also coded up a normalized MACD as described in the book and is shown in the lower image with the Cumulative Tick indicator on the upper subgraph.

Cumulative $TICK

Cumulative $TICK Behind Price with Statistical MACD

Posted in Indicator | Tagged , , , | 8 Comments

Step Moving Average

I have been doing a fair amount of futures trading in NinjaTrader of late and have come to like the Step Moving Average indicator coded for that platform. I decided to bring it across to thinkorswim. The Step Moving Average is an indicator which is only allowed to change in discrete steps calculated based on the average true range (ATR) or a user supplied constant step size. Essentially, it acts as a filter on price not dissimilar from the mechanism used in an ATR stop calculation (See the MultiStops indicator). When price is rangebound (within the constraints of the step size), the moving average line remains flat. When price is trending, the moving average moves incrementally in the direction of the trend. Shown below is a 15 minute chart of the /ES with a fixed 20 tick step size.

Pro Members can expect an update next week including the Step MA.

Step Moving Average

Posted in Indicator | Tagged , , , | 7 Comments

RSI Trading System

Continuing in my exploration of mechanical trading systems is the RSI Trading System. The concept is very simple. Enter a long when the RSI crosses a given threshold value and exit upon crossing down through a lower RSI value. The reverse for shorts: The entry/exit threshold for a short is 100 – the specified threshold for a long. For example, the hourly chart of the ES below uses a 30 period RSI with an entry threshold of 51 and an exit threshold of 48. So as the RSI crosses 51 a long position is entered and will exit when the RSI closes below 48. Now, since both longs and shorts are being traded in this version of the RSI system (I will add the ability to take uni-directional trades at a later date), the exit threshold of 48 will not be reached (by design in this case) and, in fact, a short position will be initiated when the RSI crosses below 49 (i.e. stop and reverse). This is because the user specified threshold for entry is 51 for longs which translates into 100 – 51 = 49 for shorts. I hope I haven’t lost you. By the way, I didn’t design this system. It’s just one of many that exist out there and I chose to code it up. As with the MACD Trading System I have also added the ability to implement an ATR trailing stop after a trade is initiated and subsequently the exit is determined by either the ATR stop, an opposing reversal signal, or the specified exit threshold. As with my other trading systems, the full suite of backtesting information is available as well as a lower indicator for the cumulative equity curve.
Please Note:
Trade initiation/exit symbols will show up intrabar but are not confirmed until the close of the bar. The system will execute the trade at the close of the bar at its closing price. You may elect to take the early signal prior to bar close but risk the possibility of the signal being negated by the close and forcing an exit.

PRO Members can download the latest zip file in the forum now.

! ! ! IMPORTANT ! ! !
It goes without saying, but I’m going to say it up front here with emphasis: – You should not trade this system unless you fully understand the basic concepts. You must do your own due diligence. A trading system does not relieve you of your responsibility for the trades. Just because a system shows a historical profit on your chart does not mean it will continue to do so in the future. Over-optimization of the RSI parameters to make the current chart as profitable as possible is a likely path to future destruction and is referred to as “Curve-Fitting.” Generalized parameters should be chosen within a broad range of the profitable possibilities.

RSI Trading System

Posted in Indicator | Tagged , , , | 7 Comments

MACD Trading System

Building on the basic infrastructure I developed in the Turtle Trading System, I’m developing a series of signals-based mechanical trading systems (MACD, CCI, RSI, etc). The first is a basic MACD trading system. The signals are based on either the MACD and its signal line crossing or the MACD line itself transiting the zero line. The signal is taken at the close of the bar so as to be a “worst-case” entry. I’ve also added in the ability to use an ATR trailing stop after a signal is taken or just let the system be “Always-In.” As with the Turtle Trading System, I’ve coded some backtesting information into the study so the user can get a feel for the performance over time (number of trades, total profit/loss, wins, losses, biggest winner, biggest loser, average winner, average loser, peak profit, max drawdown, profit ratio, slippage). The automated position sizing algorithm for futures trading from the Turtle Rules is also included as is the equity curve of the system to graphically represent the profit/loss. Pro Members can expect an update some time this week with several new systems included.

! ! ! IMPORTANT ! ! !
It goes without saying, but I’m going to say it up front here with emphasis: – You should not trade this system unless you fully understand the basic concepts. You must do your own due diligence. A trading system does not relieve you of your responsibility for the trades. Just because a system shows a historical profit on your chart does not mean it will continue to do so in the future. Over-optimization of the MACD parameters to make the current chart as profitable as possible is a likely path to future destruction and is referred to as “Curve-Fitting.”

MACD Trading System

Posted in Indicator | Tagged , , , , | 3 Comments

Period VWAP

After a bit of a self-imposed breather from thinkScripting I’m back with an essential (but missing from TOS) tool for everyone. This study is a period-specific VWAP (Volume Weighted Average Price). In other words, the user can select the start date for the VWAP and then plot from that date forward. It essentially represents the average price that the market participants are committed at. I think the chart speaks for itself. Raise a glass for all the Veterans today.

# TS_PERIOD_VWAP
# http://www.thinkscripter.com
# thinkscripter@gmail.com
# Last Update 19 OCT 2011

# Daily Charts and up only

input startDateYyyyMmDd = 20090309;
def beyondStartDate = if getYyyyMmDd()>= startDateYyyyMmDd then 1 else 0;

plot VWAP = TotalSum(if beyondStartDate then (((high+low+close)/3)*volume) else 0)/TotalSum(if beyondStartDate then volume else 0);

VWAP.SetDefaultColor(color.orange);
VWAP.SetStyle(curve.SHORT_DASH);
VWAP.SetLineWeight(2);
Posted in Indicator | 3 Comments