Site Meter The Lawyer Trader

Sunday, November 27, 2011

ThinkorSwim Indicator: Multi-Time Frame Stochastics

Here's a code for a multi time frame stochastic.  This will allow you to plot a stochastic for any time frame that is greater than the one that your chart is currently on.  For example, it can be helpful to know what the hourly stochastic looks like if you're trading on a 5 min chart.  I'm playing around with using this a filter for mean reverting systems..such as ignore a "Buy Signal" if the stochastic on a higher time frame is over 60.  Here's an example of using the 15min stochastic with a 1 minute chart:

Here's the code.  To use this code, copy and paste it into TOS and then delete the // marks at the top and bottom.  These marks are necessary for posting the code on blogger and the indicator will not work in TOS if you don't delete them. 

Hope everyone had a great Thanksgiving!

TLT

//

declare lower;

input aggregationPeriod = AggregationPeriod.DAY;
input KPeriod = 10;
input DPeriod = 10;
input slowing_period = 3;

plot FullK = Average((close(period = aggregationPeriod) - Lowest(low(period = aggregationperiod), KPeriod)) / (Highest(high(period = aggregationperiod), KPeriod) - Lowest(low(period = aggregationperiod), KPeriod)) * 100, slowing_period);
plot FullD = Average(Average((close(period = aggregationPeriod) - Lowest(low(period = aggregationperiod), KPeriod)) / (Highest(high(period = aggregationperiod), KPeriod) - Lowest(low(period = aggregationperiod), KPeriod)) * 100, slowing_period), DPeriod);

//

Monday, November 7, 2011

Live Market Commentary Video

Once again, looking at the Opening Range for the Eur/Usd, the SPY and the VIX to generate trading signals. 

Have a great day.

TLT

Wednesday, November 2, 2011

Market Recap Video


Trying something new...playing around with the screen recorders..maybe gonna start recording some trading examples and market commentary.  Here's a video where I talk about today's trading in the Eur/Usd.  There's a couple of opening range breakout setups and I walk you through what types of things that I'm looking at when I put on these trades.  Volume is not the best, so turn it up to hear...I'll do better with that next time.

In the video, I mention that the Adaptive Opening Range Indicator was from Thinkscripter, however, I misspoke.  It is actually an indicator that was programmed by ReadTheProspectus and is available here.  If you're not familiar with the site, you should spend some time with it and consider donating to get access to the "Donors Only" codes.  I don't know the administrator of that site and gain nothing from this recommendation...just think it's a useful website and a good blog.

TLT

Thursday, October 27, 2011

Opening Range Breakout

I went to a networking breakfast this morning and was not in front of my screen...which means there was no trading.  Getting home, it was not surprising to see that a picture perfect opening range breakout occurred on the Eur/Usd this morning.  While I'm not going to whine and claim that I would have taken the trade and squeezed every pip out of it (may or may not have happen), I will use it as an example of what the opening range breakout set up looks like.

This is a very popular set up with day traders.  Many daytraders make most of their money trading only this set up.  It works well on stocks but it also works well with currencies and futures.What you do is mark the high and low of the first 15 minutes of trading and then put the trade on when the first 5 minute close outside of the range occurs.  That's the basic trade.  You can add other indicators  or volume to confirm or use higher time frames to filter which direction you'll take..I'll leave that up to you to play with.  Once the trade is on, place a stop below (above if it's a short trade) the range and close out the trade if it trades back into the range and closes in the range.  Then you can trail a stop using your favorite method (i.e. atr, moving average, parabolic sar, etc.) or book profits once a specific profit is reached. 

Here's the chart of today's action.  Notice that the range (the bars in the red shaded rectangle) begins at 7:00.  That's because that is the time that New York opens for forex trading.  Currencies are a little tricky because they constantly trade on different exhanges through out the day.  As a rule of thumb, I trade a currency during it's home hours (7:00 central time for US) and use the first fifteen minutes.  So I would trade the USD/JPY in the evening when Japan opens or in the morning when the US opens.  You could also trade the Eur/Usd in the early morning, for those of us in America, when London opens.


Hope everyone has a great and profitable trading day.
TLT

Tuesday, October 25, 2011

Free Fallin': NFLX

Boy oh boy, I knew that I should have shorted NFLX back when Tilson covered his short and made a big media event about it...coulda, woulda, shoulda.  Netflix has basically dropped for the past 6 months and this morning it took a big plunge.  Check out the 5 min chart:
What a drop.  As for regular trading...this volatile market chopped me up a little today and I'm laying off the gas until SPY breaks 126 on the high or 120 on the low.  As for currencies, I'm looking to go long the Eur/Usd above 1.3960.  With the Euro, the price action better be very strong, as it has been incredibly choppy with all the action in Europe.

Hope everyone's doing well.

TLT

Wednesday, September 28, 2011

Leading Indicators Study Say's Bears are Still in Control

One indicator that I created a while back and have been following is called the "Leading Indicator Study."  No, these are not the economic data leading indicators, these are just different etfs of asset classes that represent the bullishness or bearishness of the market that tend to lead big moves.  It is based on the Euro (FXE), Copper (JJC), Small Caps (IWM), Emerging Markets (EEM), VIX (VIX or VXX), Long Term Treasuries (TLT), Short Term Treasuries (SHY) and Consumer Staples (XLP). 

I'm not going to go into exactly how this works, but I wanted to share the general idea...maybe it will spark some ideas with clever traders that look at such things to derive an edge.  The basic concept is to take risk sensitive asset classes, determine whether they are in an uptrend or downtrend, and then create a score based on the trends.  This particular indicator uses a couple of regression calculations to determine the trends and then it adds points for the bullish trends and subtracts points for the bearish.  Simple enough.  Regression is not necessary, you could easily use a moving average or volatility break out system in place of the regression.  The point is to look at multiple asset classes at the same time to get a heads up on what the market's current risk appetite is.

Here's a screen shot of the indicator paired with the S&P 500, note the colors of the price bars are indicative of the bullishness (green), bearishness(red), buycaution (yellow) and sellcaution(blue):

Hopefully you found this interesting and you can work out something similar or even better to implement with your own market analysis.  As you can see with the chart, price bars are red and the indicator score is a very low -92 which confirms the bearishness of the market.  That tells me not to get too excited about any rallies until this indicator gets back to bull territory.

TLT

Wednesday, September 21, 2011

CNBC Portfolio Challenge

I couldn't help myself...I had to sign up. Not gonna spend a lot of time on it (not really a revenue producing activity) but it is fun. I put together a couple of portfolios and will manage them in my spare time just for the heck of it.

Off to a good start so far..here's the rank as of today:


1068th isn't bad considering there are over 500,000 portfolios.  We'll see how it goes.

Have a good one.

TLT

Thursday, September 15, 2011

Take a Look at the EuroDollar Index over 3 Month Libor

This is an interesting indicator. Much like the TED spread and a handful of others, it tends to give good indications of whether the market is likely to move higher or lower. Nothing is perfect, but the short term interest rate markets are usually quick to move when something is anticipated in the market. Take a look at the chart, and notice the crosses on the moving averages:
I chose to use the word "anticipate" rather than signal because that's what I use this for.  It's not a signal in and of itself, it's a tool that helps gauge the likely overall direction of the market.  So why the 3 Month Libor instead of 1 Month? No special reason, you could use 1 Month Libor..the 3 Month is a little smoother when plotted with the EuroDollar. (*Note this is the EuroDollar market that is made up of dollar deposits in other countries..this has nothing to do with the Euro Currency in the forex market).

Something interesting to watch and keep on your radar. Hope everyone is managing the volatility..it's a wild one right now.

TLT

Thursday, September 8, 2011

Index Trader Indicator for Think or Swim: Using Volume, Advance/Decline and Cumulative Tick for Day Trading

I've been playing around with a day trading indicator.  It consists of the ratio of advancing stocks to declining stocks (on the NYSE), Up volume vs. Down volume (NYSE) and the cumulative tick (also NYSE).  Basically, if advancing stocks are above declining and the UpVolume for the day is higher than the down volume, this indicator will show you that the market is bullish.  To filter these signals, I use the cumulative tick.  If the tick lines up with the other two then the bars are painted green (when bullish) or red (when bearish).  If the tick conflicts with the other indicators, the bar will be painted blue.  Check out a five minute SPY chart:

This indicator is useful for day trading, as it can help you determine where the market internals are pushing the market and get you on board with the trend as it's developing intra-day.  This indicator should not be used all by itself for entries and/or exits.  It is not perfect, as there are plenty of times when the bars are green and prices just drop.  I have been playing with it more as a filter.  For example, if I'm trading using bollinger bands, I will look for long intra-day setups when the bars are green.  Or if I'm looking to fade rallies using a stochastic oscillator, I'll look to sell an over bought signal if the bars are red.  There are lots of possibilities to incorporate this and tweak it to your liking.

Here is the think script code for think or swim if anyone out there uses TOS.

//
def VolUp = close("$UVOL");
def VolDn = close("$DVOL");

def advancers = close("$ADVN");
def decliners = close("$DECN");

def BullVol = if volup>voldn then 1 else 0;
def BullAdv = if advancers>decliners then 1 else 0;
def BearVol = if volup<voldn then 1 else 0;
def BearAdv = if advancers<decliners then 1 else 0;

def BullMode = if BullVol and BullAdv then 1 else 0;
def BearMode = if BearVol and BearAdv then 1 else 0;

def upper = no;
input hidecumtick = yes;
input symbol = "$TICK";
input period = 20;
input smooth = 5;
input lookback = 4;
input filter = 300;
def p = period;
def i = barNumber();
def na = double.nan;
#input usetrend = {"No", default "Yes"};
def usetrend = yes;
rec htick = if IsNaN(high(symbol)) then htick[1] else high("$TICK") ;
rec ltick = if IsNaN(low(symbol)) then ltick[1] else low("$TICK");
rec avgh = if i == 1 then htick else Max(filter, avgh[1] + 2 / (p + 1) * (htick - avgh[1]));
rec avgl = if i == 1 then ltick else Min(-filter, avgl[1] + 2 / (p + 1) * (ltick - avgl[1]));


def hi = high("$TICK");
def lo = low("$TICK");

def Last = if IsNaN(close(symbol)[-1]) then close(symbol) else double.nan;

def amean = if IsNaN(close) then na else (avgh + avgl) / 2;
def trendmean = if usetrend AND (htick > avgh OR ltick < avgl) then amean else 0;

def bull = if htick > avgh then htick - avgh  else 0;
def bear = if ltick < avgl then ltick - avgl  else 0;

rec ctick = if i == 1 then 0 else if IsNaN(htick) OR IsNaN(ltick) then ctick[1] else ctick[1] + bull + bear + trendmean; 

def ctickavg = ExpAverage(ctick, smooth);
def cumtick = if IsNaN(close) then na else ctickavg;
def nettick = if IsNaN(close) then na else ctick;

def zero = 0;

AssignPriceColor(if !upper then color.current else if cumtick > cumtick[lookback] AND ltick < avgl then color.green else if cumtick > cumtick[lookback] then color.gray else if cumtick < cumtick[lookback] AND htick > avgh then color.red else color.gray);

def hcumtick=if !hidecumtick then cumtick else na;
def hzero=if !hidecumtick then zero else na;
AddCloud(hcumtick, hzero );
def buy = if cumtick > cumtick[lookback] AND ltick < avgl then low - tickSize() else if cumtick > cumtick[lookback] then na else if cumtick < cumtick[lookback] AND htick > avgh then na else na;
def sell = if cumtick > cumtick[lookback] AND ltick < avgl then na else if cumtick > cumtick[lookback] then na else if cumtick < cumtick[lookback] AND htick > avgh then high + tickSize() else na;

def ahi = if IsNaN(close) then na else avgh;
def alo = if IsNaN(close) then na else avgl;
def hib = if hi < 0 then hi else na;
def lob = if lo > 0 then lo else na;
def phi = hi;
def plo = lo;

#plot zero=0;
#
# Formatting:

Def TickBull = (if cumtick > cumtick[lookback] then 1 else 0);

assignPriceColor(if BullMode and TickBull then color.Green else if BearMode then color.red else color.blue);
//


That's all folks.  I have been working on quite a few indicators and strategies lately and would be happy to share more code if there is enough interest/demand.  We'll see.  Hope everyone's trading is going well.

TLT

*****Update*****
The above code has been fixed.  A reader alerted me to a problem with the coding from the original post..not sure what happen but it appears to be a copy/paste error.  The new code should work much better

Wednesday, August 24, 2011

Jobs Resigns and $AAPL Declines

A nice little drop in $AAPL after the Jobs announcement in after-hours trading.  The important thing to watch is the follow through tomorrow morning.  If there is consistent selling but not panic selling, I would be concerned.  The pros will fade an obvious panic dump but calm consistent selling will be a sign of sophisticated people trying to unwind their positions.  Guess we'll see.

TLT

Thursday, August 11, 2011

Old Resistance Holds with $TLT

It was weird..just a few minutes ago I was scanning through some charts on FreeStockCharts and noticed that TLT, the 20+ year long bond etf, stalled out an upward advancement right at a green line that had been marked on the chart last summer.  Marking certain charts with red and green lines used to be common practice for me.  I haven't done it in a while but I do like to look at where price action is compared to old support and resistance lines..especially when price reverses right at one.  Check out the chart:

Hopefully all of you are not just holding up but also profiting from this market.  Volatility can be a great thing for certain styles of trading.  I think the worst is likely over, but you never know.

TLT

Monday, August 8, 2011

Headline Risk?

Headline Risk

What Does It Mean?
What Does Headline Risk Mean?



"The possibility that a news story will adversely affect a stock's price. Headline risk can also impact the performance of stock  market as a whole."


Read more from Investopedia.

It's hard to say, as the market never likes a "negative" event that has never occurred before.  Was there really any new information?  Does this really change anything?  There's a good chance this could be a big deal, but the other side of the coin is that the market will come to terms with it and start discounting what rating agencies have to say.

Just hang in there and don't panic.  I could be wrong but I don't see a "2008" scenario here.  As always,  only time and price will tell.


TLT