Archive for the ‘Trading System Development’ Category

Example RSI Divergence Trade Setup: $TSLA (Tesla Motors Inc.)

February 16, 2017

All indicators are only a method to repackage complex information in a simple and repeatable way.  I have said before that divergence indicators (like my own Multidivergence Indicator) are not good trade signals by themselves. What they are good for is context.  You will still need some entry criteria of your own to decide when to enter a trade.  You should also have a stop and a target identified before entry, which are basically a plan for if you are wrong and a plan for if you are right.

Here’s a trade I did not take, but I saw developing in real time. It becomes a useful case study for a divergence setup in $TSLA that had a positive outcome.

There was a divergence between the high prices and the RSI indicator for a week or two beforehand. By itself, that doesn’t tell you to sell. Price kept pushing higher even in the face of the divergence. The divergence eventually resolved and went away, and the uptrend continued. But it was telling you that in this context, the trend might be getting tired. You could be looking for a reason to sell. If you try to front-run it, you can get destroyed. Bull markets are built on the smoldering bodies of early bears.

Almost everyone saw that big ugly candle in $TSLA the other day, selling off after threatening to move into all time highs. Using the context of the earlier RSI bearish divergence, this candle was another good piece of information. You have several signs pointing to reversal now. One trade plan could have been to sell a break of the low of that candle, with a stop above the candle high just in case you are wrong. Whatever you do, STICK TO THE ORIGINAL STOP LOSS. Stops only move toward profit, never toward more losses. If you were wrong and price had spiked to new highs in the trend you’d eat the 8 points or so and move to the next trade. In case you were right, maybe you set a target to cover around $255 support, or maybe you sell half and let the rest ride until you see a bullish reversal candle. There’s a lot of great options when you are right! That’s the easy part.  

Here’s what happened:

If you had taken the trade, you had a big follow-through day today on the downside, and you’d be sitting on about 10 points of profit.  One more good day and your target could be hit. 

Remember, indicators only give you information. You as the trader have to decide what to do with it, taking into account your psychology, risk tolerance, account size, and all the other fundamentals. 

Just 2 NQ Points A Day

January 19, 2012

Just 2 NQ points a day. That’s all I ask. Instead of trying to get every last tick out of a given move, I am content to consistently pull out a little bit, over and over. This is the intent of the strategy.

The strategy is based on these market attributes:
1. The index futures (NQ Nasdaq emini in my case) tend to back and fill a lot. One way trends are (relatively) rare. Important price levels are revisited over and over again.
2. Market prices tend to move. Price doesn’t hold still for long.

Two points and then quit for the day should be achievable almost all the time. I just want to make chip shots. Just be consistent and do it over and over.

On a 5 min NQ chart, around half of all the bars are wider than 2 points:

20120119-231821.jpg

The average daily range for NQ lately is near 40:

20120119-231839.jpg

A two point target is in the noise. But that’s the point: Instead of trying to drink every last drop of a passing river, I want to dip my cup in and just catch a little of what is flowing by. I don’t need to catch an entire wave. Just a little portion of it.

All this time as a loser, I have been trading in hopes of catching a big move. I might have a 5 point target and a 2 point stop. I was constantly setting myself up for failure. I would enter at the market and hope for a big move, ready to take the small loss if need be. That risk:reward might look attractive, but my stop was being hit nearly every time.

So I literally faded my strategy. I looked at the current market, and placed limit orders to fade moves roughly 3 points away from the current price. That put my entry at pretty much exactly where my stop loss would have been if I traded my old way. Once one of them hit and was filled, I set a disaster stop of 5 points (basically an arbitrary number at this point), and a profit limit order just two points away from my entry. Then I sat and waited. My profit target would be hit more than 80% of the time. If the market kept going against me, I waited for it to come back. I honored the disaster stop, but in the first 18 paper trades it was never hit. Most of the time, I could get out for break-even or just a small loss close to 2 points. That exit for a small occasional loss is exactly where my trailing stop for a profit usually was under my old strategy.

To avoid fading a strongly trending market and getting my disaster stop hit, I didn’t use this method near the open or market close. I avoided fading near the highs/lows of the day. I waited for the afternoon doldrums and tried when the market was listless, choppy and noisy, putting conditions in my favor.

Another positive element in this strategy is the very short time that I am exposed to the market. In some of the engineering applications I encounter in my work, a trade-off is made between accepting risk vs. having reduced performance. A probabilistic design method is employed. Instead of designing for the worst case failure mode at the worst possible time in all conditions, we look at the probabilities that these conditions may overlap. If the worst case failure only happens at very extreme conditions, and a vehicle only spends a tiny fraction of a percent of its service life at that condition, designing for this condition puts a large burden of weight and performance reduction for the entire class of vehicle across the whole service life. We can slim down the vehicle by only designing to a probabilistically acceptable failure condition. We still have to avoid a disaster, so we make sure any failure is not catastrophic by keeping enough margin in the system. We just allow a failure to cause an aborted mission or acceptable amounts of damage. Back to my trading: most of these trades last only a few minutes or so. While big adverse moves happen in the market, the odds that one of these moves come during the few short minutes that I am exposed to the market are very small. If I’m always in the market and holding positions, then the odds are high. But the shorter my exposure time, the smaller the probability of a big event becomes. Since the probability is not zero, I still have the disaster stop, just like in the vehicle design. LTCM didn’t have a disaster stop. They KNEW that it was statistically “impossible” that they would see the conditions that would blow them up. I am not naive like that. A non-zero probability is still possible. You have to prepare against it even though you will probably rarely see it.

The biggest weakness I see is if I end up fading a persistent trend. I’ve paper traded this strategy a bit, and on a strong trend day it’s easy to rack up two 10 point losses in a hurry. That wipes out a lot of winning trades. This strategy would be best used during choppy sideways markets. How to rigorously define that is not clear to me. I guess that’s where I often get hung up. I can’t know exactly if a move will turn out to be an adverse trend every time. I have to define a way that works much of the time an accept the few times it when it doesn’t. I want to take discretionary elements out for now. The book “Trading in the Zone” is helping me to think more probabilistically rather than in “right or wrong” terms.

So the idea is literally fading my old self to have a winning strategy. I’ll be doing some back testing with it soon. If you have any comments about this
approach, I’d love to hear them.

Fixed Stop Loss and Profit Target Strategies for Think or Swim

November 2, 2010

As promised, here are four strategies showing how to implement fixed stop losses and fixed profit targets for TOS. You need to add these to a chart with some entry strategy. I have included two example entries for you to test out if you want. These are called “Justbuy” and “Justsell”. If there are two green bars in a row, it goes long. If two red bars in a row, it goes short. Otherwise, the targets and stops manage the trade.

You can run a backtest on it to see the results, and play with the stops and targets to see if it improves (or worsens!). To me, this is a good quick way to test if you have any edge in an idea. If there is one, it will show up right away in a simple test. If it takes fancy tools and algorithms to squeeze out a drop of an edge, but you don’t have direct market connections and 8+ figures of capital to employ it, then you are fooling yourself and asking for pain.

These strategies are free. Download “Fixed Stops and Targets.zip” from “Released Thinkscript Strategies” on my Google site. As always, leave a comment if you have any questions or need help setting them up!

Trading System Thoughts: Context and Using Cumulative Tick on ES/NQ

June 21, 2010

My time is being stretched in many directions–custom projects, donor requests, beginning iPhone app development, and working on my own trading skills. This post is one focused on my recent trading thoughts.

First, an unsolicited testimonial. I’ve been part of Richard Todd’s Move the Markets Team for a while now. I find it to be incredibly valuable. If you are looking for a community of experienced traders that are serious about improvement, both of themselves and of newer members, look no further. I recommend it highly. There are a lot of free areas to start with, and if you want to go deeper, he charges a modest monthly fee for full access.

As part of a conversation I had recently with Richard, I was once again reminded about the importance of market context. As I talked about in my WWJT posts, in a trending market, almost ANY trend-following setup will work. In a choppy environment, almost ANY trend-following setup will die horribly. The specific setup DOES NOT MATTER. There is no “best” set of parameters to filter out the losers on a setup basis. The problem is not with the setup, it’s with the market context. A raincoat is not the best clothing to wear on all days, just on rainy ones. Flip flops are ideal footwear on the beach, but not for climbing Mt. Everest. You pick your clothes based on the weather context you expect to encounter. Don’t agonize over whether a blue raincoat or a yellow raincoat works best, and don’t look for the magic set of sandals that keep you warm even on a snowy day. Metaphor overload, core dump…

The most important thing is to identify when the markets are likely to trend, and then to apply a trend-following setup (buy a pullback in a trend, buy a breakout, etc.) or sit out. Conversely, identify when the markets are choppy and listless, and apply a range-bound setup or sit out. I have demolished myself in the past two Augusts by playing dummy trades (trend continuation) in a seasonally flat and choppy market. I get stuck in the trap of obsessing over the entry, target and stop parameters, so I needed this reminder to get back on track.

I believe your time is best spent practicing contextual skills rather than mining for the Holy Grail setup or magic parameters. Try these steps:

1. Become proficient in identifying chop and trends after the fact. This one should be relatively self evident. Look at the day’s chart after the close, and annotate where the trends were, and where the chop was. Continue to do this on intraday charts until you can do it instantly and effortlessly.

2. Go to live data and practice identifying whether the market is in a trend or in chop RIGHT NOW. Don’t worry about if the market is going to keep trending or keep chopping. Just correctly identify what it is currently doing. Continue until you can do it instantly and effortlessly.

3. The last step is to start to try to predict what is likely to happen next during the day. Will the trend be likely to continue? Will the range probably be broken? Many things can give clues to this including volume, time of day, support/resistance levels, tape speed, pending news announcements, and so forth. Along the way you should also gain the skill of predicting whether a trading day may be trending or choppy before the day begins, and also knowing what events and price levels would imply a change to that prediction. This one can take years of screen time to become proficient. Patience and work are needed! I have started to notice myself having the beginnings of this skill. I can only chalk it up to screen time. Watching what has worked, what has failed and what has generally happened in the past. Feeding years of price data into the most complicated neural network there is: the human brain.

Note that in all of these things, I have mentioned words such as “likely to continue” and “probably”. None of this is an exact, deterministic science! You also have to be able to think, make decisions and accept outcomes probabilistically. That means that the specific outcome of any one event does not determine whether a probabilistic decision was the right one or not! In a deterministic situation, the outcome judges the decision. Gravity always pulls you down to the earth, 100% of the time. Jumping off a cliff is always a bad idea, because you will always plunge to the bottom. In a probabilistic situation, it’s the odds up front and the information you had at decision time that say whether a decision was the right call or not. The odds will play out to a degree of “rightness” in the long run, even though you may be taking a beating in the short run. This way of thinking is very difficult for many to attain, including myself. My Outcome Simulator is one tool that can help. The excellent book Trading in the Zone: Master the Market with Confidence, Discipline and a Winning Attitude by Mark Douglas is another good resource. But unless you are hard-wired this way, and most of us aren’t I would imagine, this takes PRACTICE.

Now, I’ve been watching the cumulative tick on ES 5 minute charts. I’ve noticed a couple of things. Assuming that the context is a trending market, the cumulative tick does well at picking the trend direction and also giving an entry spot. If the cumulative tick changes from bearish to bullish, then buying the first DOWNWARD tick spike across the average of the tick lows gives a great entry point. You are basically buying the first pullback in what you hope turns out to be a new uptrend, but are using the tick to tell you when the pullback is in play instead of choosing it based on price alone. If you continue to get downward tick pressure on the next bars, that clues you in that the uptrend may be failing. Otherwise, buying should pick back up and you have a winner in very short order. This strategy would work great with a partial exit, taking some off after some number of points and trailing the rest. Here’s an example paper-trade I took in the NASDAQ-100 e-minis (NQ) today:

I bought the gap fill on a tick downspike (gray oval). The tick downspike is the entry signal, but the reason for the trade is the context: I didn’t buy the first downspike because we were still in space over the gap. The second tick downspike was the first retrace to yesterday’s high. Also, a strong opening gap = bullish tones for the morning, so that said to fade the downspike, not go short. I expected a bounce, and we got it, all the way to new highs, even! Opening gaps that clear the prior day’s highs and lows are typically strong. Gaps inside the prior day’s range are less so.

Back to the trade: Ended up “buying” 1 tick above the day’s low so far (!) I traded 2 contracts, both with a 2 point initial stop. One I “sold” after a 3 point target (first green oval) and the other I put on a 3 point trailing stop and “sold” much higher (second green oval). Net +12.5 “points”.

I’ll be posting more charts and a modified cumulative tick indicator sometime over the next week. I’ll also be working on my market context skills, because that is the only effective way to minimize your losing trades, and is the foundation to using a setup in the right way. My ultimate goal is to choose a trending setup and a chop fade setup, know when to use them, and then consistently apply them, accepting the outcomes as they happen. That should be my last hurdle to arrive at net profitability. It’s been a long, hard journey, but I think I can see the oasis from here!

Weird Cumulative Tick Plot: Distribution or Math Artifact?

April 23, 2010

Okay, this is making me scratch my head a bit. Here’s a plot of the ES with my “Messing around with Cumulative Tick” indicator on it, showing 1 hour bars since March 1:

There are two sub-panel indicators. The upper is showing a histogram of the high and low values of the NYSE Tick. There are also two lines. The green line is an EMA(20) of the high values of the Tick. The red line is an EMA(20) of the low values of the Tick. If the Tick high was above the high EMA, the Tick bar is green, else it’s gray. If the Tick low was below the low EMA, the Tick bar is red, else it’s gray. The third dashed white line is the mean of the high EMA and the low EMA.

This is graphically showing what is going on under the hood in the lower indicator, which is my cumulative tick indicator. If a Tick high is above the high EMA (showing as green), then the difference between the high and the EMA is summed. Opposite for the Tick lows. So basically the more extreme a spike in the Tick compared to the corresponding EMA, the more it will move the cumulative tick.

You can see that we’ve been in a consistent downward trend in the cumulative tick. The Tick spikes on the downside have far outweighed the spikes on the upside. Normally I would chalk that up to underlying weakness in the market, and stock distribution in the face of rising prices. But it has been persistent in the face of a strong uptrend. I noticed two things:

1. The high EMA is further from the zero axis, so the strong high Tick readings aren’t getting as much credit. The low EMA is closer to the zero axis, so the strong down Tick readings are getting maybe too much influence.

2. The mean of the high and low EMA’s is almost always above zero. The broad buying strength is showing up here, but not making its way into the cumulative tick calculation.

Back when I came up with this idea, I was assuming that the zero line would be the natural balance point for Tick readings. And in a sideways market, that’s probably true. In this bull phase, it seems to be based around +200. If the broad undercurrent is important, then I need to add it. If only the extremes are important (the rest being noise) then we could be seeing huge weakness under the market’s hood. I tend to think it’s the first, and that I need to add a trend component into the calculation.

What do you think? Is this highlighting a divergence in the markets, hidden stock distribution, or is it an artifact of the numerics of my calculation?

UPDATE: I added the value of the mean of the EMA’s into the calculation. At every bar, the upspike-downspike+mean is calculated. So a -300 net downspike will be tempered by a +200 upward mean value. Then the chart looks like this, and all is right with the world:

I updated the code in “Work in Progress” with the code I’m using for this. It’s the same indicator for both sub-plots. I just hid different plots for each one manually in the chart studies window.