## Tuesday, December 11, 2012

### 'tis the season(ality) part 5

here's how i determine whether an equity is on track: i plot a second seasonal projection but anchored on the date ten bars old. here's how i set up the second seasonal projection study - click the edit studies button on the upper tool bar then set the parameters as in the image below:

it is important to set the hpi min pct to some high number to suppress plotting a second hpi indicator which is visually confusing.

afterwards my chart of xrt looks like:

so from this i see that xrt has been closely tracking its season. the season lifts in mid-january and peaks in april.  there is about a 62% chance that xrt rises to 70 or higher by april if the seasonality holds. i plan to be buying xrt in the first week of january, if it executes the dip so much the better.

## Tuesday, December 4, 2012

### `tis the season(ality) part 4

now let's take a look an equity with some strong seasonality:

the mathematical measure of the spread of data is the standard deviation. it was developed to help scientists describe how variable is the repeated measurement of the same thing. in the math literature it is provable that 68% percent of the data points can be shown to fall within one standard deviation from the average. when applying this to seasonality for traders it quickly became apparent to me that what is of interest is when the lower standard deviation line tracks above the flat line in a bullish season or when the upper standard deviation line tracks below the flat line in a bearish season. however, for traders the important thing is how much of the data lies above the lower line and if one uses a 1x standard deviation then 84% of the seasons will track above the lower line. however, if one uses the 1x multiple then one will find that hardly any equity has a season that is so predictable. hardly any of the 1x std lines cross the flat line within a reasonable holding period for traders, say 3 months or so.  the rigorous standard for scientific publication is too rigorous for trading.

in jeffery ma's book, the house advantage,  jeffery claims that his mit blackjack team held only about a 5% advantage over the house when the card count was right. say 52.5% to 47.5%. so i applied this principle to the multiple i apply to the standard deviation of the seasonality. i discovered that 0.3 standard deviations provides a fair but selective number of short term seasonality plays. mathematically it can be shown that 24% of the data falls within 0.3 standard deviations of the mean, or that 62% of the data tracks higher than the lower 0.3x band. if that 62% translates well into the probability of success in a trade then that is a reasonable sort of edge.  to my eye this multiple produces a band that tracks closer to the projection average and provides a much better feel for the seasonality. look at how long the splash hugs the projection average for xrt in the spring before spreading out. to me that's a really good indication that xrt has a tradable season.

however, with this loose a standard, it would not be surprising at all to see that maybe xrt is not on track to repeat this seasonality this time around the wheel. how can we evaluate if xrt is on track with the season? that will be the subject of the next blog ...

## Monday, December 3, 2012

### 'tis the season(ality) part 3

step 3) add a seasonal projection anchored on the most recent candle:
 click the beaker icon on the top tool bar.
 add sdi_seapro5, adjust season len to 5, adjust the colors of the plots fl (flat line) and pa (projection average) to something that contrasts well with your background.

you should now have a screen that looks like:
 spy with sdi_seapro5 on weekly chart
this shows you the average move that spy, the s&p 500 etf, has made around this time of year. it looks like we should decline a little til the end of february and then rally into april.

do you trust that?  do you trust it enough to put money on it?

this is the problem i attempt to address with some of the indicators. you can average any random set of prices together but average randomness is still random. to be reliable, the individual seasonal projections should bunch up and move together. here's a view of the individual seasons seapro is averaging (you can plot these by selecting show individual seasons):
﻿﻿
 spy with individual seasonal projections, green are most recent 2, red are oldest 3.
i see the last 2 years were sideways to up, while the oldest 3 years were sideways to down. this is really rather inclusive, imho, and i would not base a trade on this. there are better, more mathematical ways to judge good seasonality which i will explore in the next part.
﻿﻿
﻿﻿

## Sunday, December 2, 2012

### 'tis the season(ality) part 2

step 2: make 52 bars of right expansion.

go to style/settings/time axis and set the expansion to 52 as in the picture:

one can select more but the seasonal projection will stop after one season of time. selecting less will hide part of the projection but why? the magnification controls on the thinkorswim charts are superb. furthermore, you can select keep time zoom as i have in this dialogue, which will retain the zoom when you switch equities.

## Saturday, December 1, 2012

### 'tis the season(ality) part 1

of all the studies i have created, the seasonal projection studies are the ones i look at every day. however, it has taken some time to arrive at a setup that has that kind of staying power on my eyeballs. if you use my sdi_seapro5 study (seasonal projection of 5 seasons) then you'll want to see how i think you'll get the most out of it. i think there's more than a blog's worth of info I want to put out so this will be a series.

step 1: use weekly aggregation:

i like weekly charts for the simple reason that the most reliable technical analysis is drawn from the weekly charts. my focus on this time-frame is based on the idea that institutional investors are acquiring or closing positions over weeks and months, not days, hours, minutes, seconds, ticks. it is institutions that are waiting with bags of money at these longer term technicals for the right price.

secondarily, i find that the seasonality averages drawn from weekly charts are more valid. most years have 52 weeks, so averaging what happened in week 7 of the last 5 years has validity. some years have 53 weeks. a 53 week year comes about because the last day of the year falls on sunday, the default start of a week. now, the seasonality in my study is based on a moving anchor week, usually the current week and the comparison is averaging what happened multiples of 52 weeks ago (e.g. -52,-104,-156,-208 and -260 weeks ago.) a 53 week year is not really a problem. to see this, suppose it is week 53 of 2006, the last 53 week year. the comparison is going to look at week 1 of 2006, 05, 04, 03, and 02. but this is what one would want anyway because week 53 really only contains trading data from the first trading days of the new year of 2007 (nothing trades New Year's Eve except maybe some cold sores ;-)

however, i do have some reservations about the validity of seasonality drawn from daily charts. there are all kinds of issues with comparing price movements on a day-on-year-ago-day basis. first of all, what season length do you use? most u.s. equities have about 251 or 2 trading days year, depending on leap years. however, if you want to look at futures or forex, they both have about 260 trading days to the year because they trade on US holidays. secondly, there might be a day-of-week issue. if it is monday and the bar 251 bars ago is a friday, is that really a fair comparison? i'm not sure. also, imho, actionable seasonality is an annual event, more or less, when it is present at all.

in any case, the precision of seasonality is not such that it would identify the ideal day to enter a trade. it can be +/- two or three weeks. later, i will show how i identify good seasonality setting up and how i time the season.

next up more chart settings ...

## Sunday, September 16, 2012

### my etf universe

in my previous blog on stock-straddles i mentioned criteria for finding appropriate etf's. so i have prepared a list of the etf's that satisfy my criteria and i share it with you now:
﻿
 nonlevered, liquid etf's with liquid options

this was created by scanning all etf's for those that have greater than 600,000 shares traded daily and are optionable. then i winnowed out all leveraged etf's and those whose options were not liquid and added vxx which falls under the designation of etn. i think this list of 35 etf's is surprisingly short considering the thousands of etf's that are clamoring for investor dollars but that is to where i want to shrink my universe. i am currently running stock-straddle trades on the first four.

## Friday, September 14, 2012

• initiate stock-straddle trades only. that is, long stock and short the straddle  (short the call and short the put at the same strike.)  i sell the straddle in the back month.
• trade only unlevered, liquid etf's with liquid options. unlevered etf's have low risk of going to zero and other adverse corporate events. this strategy relies on future expiration cycles perpetually being available.  levered etf's suffer from the death spiral syndrome whereby they never seem to recover in price even though the underlying index does. the back month atm options must have a narrow (like 15 cents or less) bid-ask spread and must have a couple hundred or more contracts of open interest. the underlying etf must trade 500,000 or more shares/day. it is interesting to note that most etf's satisfying the volume requirement also satisfy the liquid option requirement.
• prefer etf's with a high volatility index. the emphasis is to make money on selling premium and the options aren't going to sell for much if the vol is low. although, low vol is not a reason to quit one of these trades.
• roll eligible options as soon as the extrinsic value is worth less than the roll value. the options become eligible for rolling when they age into the front month. this way the extrinsic value is constantly being tacked on to the back month and the risk of early exercise minimal. this rule applies equally well to both the itm as well as the otm options.
• keep a gtc order to buy-back the options for a nickle. if these execute then sell the 30 delta options to complete a vertical roll. the trade may evolve into a stock-strangle trade but that's ok.
• control the beta-weighted delta with stock-straddle trades on sh and vxx. stock-straddle trades are neutral-bullish so a portfolio of these can cause your net-liq to sag when the market retreats. sh is a bearish etf on the s&p 500 which meets my selection criteria. vxx is an etf that trades vix futures and though it is not explicitly a bearish etf, it does create negative beta-weighted delta.

the first principle that makes these stock-straddle trades work is the statistical fact that the highest probability of future price is the current price. thus the probabilities favor time-decay of the short options. being short a call and a put guarantees that at least one of the options will be profitable.

the second principal stock- straddles stand upon is the addage: time-is-money. thus, a short option that has appreciated can be rolled to some future expiration for a credit in all but the most extenuating circumstances. such circumstances could only occur in a stock paying a large one-time dividend and that is a rare occurrence for stocks  and more so in the etf world.

## Saturday, September 1, 2012

### a new trade on my favorite etf ...

﻿﻿iwm, the russell index etf, of course!

this week i put on a frank walsh style trade on iwm﻿. frank is a frequent commentator/educator on the thinkorswim chats (what's frank thinking?). he has been advocating a trade that is combination of a covered-call and a naked put. if you understand the concept of put/call (call=stock+put) parity then you will immediately say, ah, but those are the same thing! true dat! if one plots the p&l graph for a covered call and a naked put at the same strike one gets the same hockey-stick graph with a fixed max profit on the upside and a long handle down to zero underlying price on the downside.

the same, but different!

the difference is in how one thinks about and manages the trade. here's my full iwm position:
 iwm full position
if i let this ride to expiration then there is a 65% chance of profit, which is very good. however, notice though that if i expire under the \$81 strike then the call will go out worthless and leave me with a stock position (assuming i roll the put position.)

here i have unchecked the stock position from the analysis and redrawn the break-even lines.  thus, there are three outcomes: <76, between 76 and 86, >86. here's my action plan for these three expiration-week outcomes:

• <76. the call should be nearly worthless so i will roll the call to the same strike in the back month. if there is not sufficient value to call roll then i will consider a roll diagonally down but only to a 20 delta option. alternatively, i evaluate whether rolling further out in time is a better value. the put will be itm (in-the-money) and my action plan calls for rolling the put too. yea verily, this does write-down a loss but time is money, the roll, most often, generates a net credit. i will evaluate the roll value on the put when the time comes to see if maybe rolling deeper in time is a better value. with two-year leaps trading on iwm there is no shortage of deep-time options available.
• between 76 and 86. in this range both options expire profitably and i simply roll them to the back month at the same strikes.
• >86. same as <76 but reverse the logic for call and put.
in a nutshell that is it.

the tricky part is coming to grips with rolling the itm options. it's all in the way that one thinks about it. if you feel that buying back the itm option is a loss, and a loss is a loss, period, then maybe you need to follow a trade like this in a practice account first. there are always future months to roll to (otherwise we have bigger problems), thus, i have come to view the roll on the itm option as a loan. i am loaning the market some money and receiving what is usually very generous upfront interest payment on the loan in the form of the roll credit. i compare the roll credit to the size of the loss i am writing down, many times it is in excess of 30%. why would i eat the loss and throw away the opportunity!?

of particular note, in the case of an itm call, i am loaning out unrealized profits on the stock. the underlying might double or triple but i will always be able to roll that itm call because i have the stock. almost inevitiably the postion will retrace in some future month when stock holders get impatient or worried and i get to collect on my loan, keeping the "interest payments" of course. likewise for the itm put, but here i am loaning out cash from my account. that should be no problem though because otherwise my broker would not have let me sell the put in the first place and the most cash i would be loaning out is the strike price x 100, the cost of the shares.

all-in-all this trade strategy is heads i win, tails i win later.

﻿
 dave says: true dat!
﻿

## Sunday, August 5, 2012

### finding the vig in vertical spreads

vigorish (or vig in gambling parlance) is the house cut on a bet pay-out. if there is a theoretical even-money payout on a bet then, by decree, the house always pays a little less. this way the house creates a sustainable business without charging fees, because their risk/reward ratio is engineered to be less than their win/loss ratio (more on this below.) now the fact that brokerages do charge a fee for play, i.e. the commission, maybe implies that their vig is not so certain or as big as the casino's. to be able to judge what a brokerage's vig is at all you would need a way to determine even-moneyness, which when it comes to pure stock pricing is as subjective as it gets. however, for certain kinds of option trades, namely vertical spreads, it is possible to calculate a theoretical even-money price using the thinkdesktop analyze tab. here's how:

bring your perspective vertical spread into the analyze tab by setting up a trade in the trade tab and then select analyze duplicate trade in the drop down you get from clicking the button just to the left of the trade on the trade tab (make sure the price lock is in the unlocked position so you get the mark, or mid-bid/ask, price for the spread.)
 gld credit vertical in trade tab
now, in the analyze tab you will need to set up two components - the probability date is adjusted to expiration friday, which, in this case, is sept. 21, and, the slices are set to break-even on sept. 22 (the saturday after friday expiration.)
 gld credit spread in analyze tab
the even money price of this vertical spread can be determined directly from the probabilities. since this is a credit spread I take the probability of loss and multiply by the width of the strikes thus: .39 x \$1.00 = .39 (if this had been a \$2 wide spread then the even-money price would have been .78.) so, if even money on this spread is 39 cents and it is selling for 36 cents i discern that there is a 3 cent vig for the buy-side of this spread. that buyer may or may not be the market maker, i don't know. what this does tell me is that the credit i am receiving is very close to the worth of the risk i am taking, if i have to hold into expiration. since the probability of a win is 61% then the laws of chance favor a run of winning luck on this side of the trade, thus, the vig is maybe worth-the-while.

now, for a debit spread the calculation is slightly different. i take the probability of winning and multiply by width of the strikes thus: .39 * 1 = .39 as shown below for the buy-side of this same spread:
 gld debit vertical in analyze tab.
this says that the price i am paying for the potential reward is priced at a 3 cent discount to the even money chances of winning on this spread, if held to expiration. i will have to sit for a 61% chance of a loss on this trade which laws of chance would favor for runs of losing trades on repeated undertakings of this type of trade, but on large numbers of such trades I should come out 3 cents ahead, excluding commissions.

geeky mathematical aside:

an even-money trade occurs when the win/loss ratio equates to the risk/reward ratio or:
(1)   win/loss = risk/reward
if i am trading even-money then there is no free lunch. if i win frequently then i should lose big on the occasional loss OR if i lose frequently then i should win big on the occasional win.
(2) risk = strikewidth - reward
this is the definition of a the vertical spread. the expiration price of the spread can be no greater than the strike-price differential between the short and long option. thus reward+risk must equate to strike price width.
(3) win probability = 1 - losing probability
something's gotta happen, a win or a loss. i discount the miniscule chance that the price of the underlying is exactly the break-even price at expiration - that's a little like the chances of a flipped coin landing on the edge.

now, by substituting (2) and (3) into (1), i get:
(4) (1 - loss)/loss = (strikewidth-reward)/reward
now, by dividing each term of the parenthetical expressions in (4) by the respective divisors, i get:
(5)  1/loss -1 = strikewidth/reward -1
finally, by adding 1 to both sides of (5) and solving for reward, i get:
(6) reward = strikewidth*loss probability
this is the math of the method of finding the even-money price of a credit spread that i demonstrated above.

if your eyes haven't glazed over from the sheer geekiness of the above, relatively simple, high school algebra, then, you might find it a worthy exercise to show that:
(7) risk = strikewidth*win probability

the even money price of a debit vertical.

## Saturday, July 21, 2012

### thinkscript included: scanning for arrows

people have written me that they are having trouble using my sdi_itsig in a custom scan filter on the thinkdesktop platform. the problem appears to be that sdi_itsig has too many plots. user written studies must have one and only one plot to be eligible for use in a custom scan filter. so rather than rewrite sdi_itsig, i have written a new study that is scanner friendly. i call it sdi_3ga.

3ga is a stripped down version of itsig. it only looks for three green arrows. if you add it to a chart it plots a line that has two values, 0 and 1. while a 0/1 line is not very interesting to look at, sdi_3ga, can be added to a custom scan and that is its entire purpose.

the thinkscript is at the bottom and i assume you know to add a user written study to your platform.

here's how to work with sdi_3ga in the scanner:

click the scan tab, then click stock hacker. you should have a screen like:
click add study filter, then click the pencil icon. you get a pop-up like:
click the editor tab and you get:
in the editor textbox replace the text "ADXcrossover()" with "sdi_3ga()".
you can also select the type, fresh or all.

click ok then ok on the warning pop-up and you are good to scan.

here's the thinkScript:
######################
# sdi_3ga: Three Green Arrow
#hint: Scan friendly study that plots a 1 when investool green arrow signals are present rev: 1.0
http://www.smallDogInvestor.com
# author: allen everhart
# date:19jul2012
# copylefts reserved. This is free software. That means you are free
# to use or modify it for your own usage but not for resale.
# Help me get the word out about my blog by keeping this header
# in place.
input type = { fresh, default all};
def Fulld = StochasticFull("over bought" = 75, "over sold" = 25, "k period" = 14, "d period" = 5)."FullD";
def stochArrow =
if fulld > 75 then 1
else if fulld > 25 && fulld[1]<fulld then 1
else 0;
def greens = if stochArrow && MACDHistogram("fast length" = 8, "slow length" = 17, "average type" = "SMA")>0 && close>SimpleMovingAvg(length = 30) then 1 else 0;
plot sdi_3ga =
if type==type.fresh && greens==1 && !greens[1] then 1
else if type==type.all && greens==1 then 1
else 0;

## Saturday, July 7, 2012

### thinkscript included: the trouble with trin

a popular measure of market breadth is an indicator called trin (and also trin/q on the thinkdesktop platform.) these are also known as the arms indices. the problem i encounter with trin stems from my desire to plot it as a lower study indicator on a normal linear chart of the related futures products, /es and /nq, resp.  you see, trin, being a ratio of several other breadth measures ((advancing stocks/declining stocks)/(advancing volume/declining volume)) presents a neutral reading when it is at one, a bullish reading for values less than 1 and a bearish reading for values greater than 1.

the first trouble i have with trin is that it is an inverse indicator. it indicates sell when it is up and buy when it is down. just as a matter of sanity i always try to rejigger such indicators so that up is a buy signal and down is a sell signal. this is not hard to do just plot the negated (-trin) value.

the second trouble i have with trin is that it is a nonlinear indicator. values in the bearish area are linear, with a value of 4 being twice as bearish as a value of 2, but values in the bullish area are logarithmic with bullish readings of 1/4 being twice as bullish as 1/2 (and which correspond to the bearish 4 and 2, respectively.) a plot of bullish trin readings look kind of squashed on a normal, linear-grid chart, even if one is plotting the negated value. what i want is to plot bullish readings as their inverse value, 1/trin.

finally, the third trouble i have with trin is stitching together these two disparate views into a single indicator. the solution i use is to re-origin the neutral trin reading from one to zero. thus, if trin is greater than or equal to 1 then i will plot 1-trin otherwise i plot (1/trin)-1. this is the view of trin that i present in my study called sdi_breadth. here's a picture of what i'm talking about:

﻿

a bonus of this view of trin is that we can plot a legitimate moving average of the values. this is true because bullish and bearish readings are on the same scale - a one point change in the bearish area is equal to a one point change in the bullish area (not so for the raw trin plot.) so the green/red line is a 6 bar moving average of the histogram plot, brc (breadth corrected.)

also, values of raw trin that are close to one are more-or-less neutral. likewise values of brc that are close to zero are neutral. only now with brc we can equitably declare values within say, .2, from zero to be more-or-less neutral which i show in grey.

so here's the code:

#########################
#hint: a view of the TRIN and TRIN/Q ratio's that is inverted and reorigined from the neutral reading of 1 to 0. this unpancakes the bullish readings to create an indicator that is evenly represented on an linear scale, can be averaged and analyzed technically. plots bright red for increasingly bearish bars, bright green for increasingly bullish bars, darkened bars represent fading and grey bars represent weak readings below the threshold. rev: 1.1 source: smalldogInvestor.com
# rev: 1.1 - get the color right on the first bar
# author: allen everhart
# date: Jul 17, 2010
# copylefts reserved. This is free software. That means you are free
# to use or modify it for your own usage but not for resale.
# Help me get the word out about my blog by keeping this header
# in place.
declare lower;
input source = { default "\$TRIN", "\$TRIN/Q"};
#hint source: ratio selection
input threshold = 0.2;
def trclose = close(source);

plot brc =
if trclose >= 1 then
1 - trclose
else
(1 / trclose) - 1
;

brc.SetPaintingStrategy(paintingStrategy.HISTOGRAM);
brc.AssignValueColor(
if absValue(brc) < threshold then
color.gRAY
else if isNaN(brc[1]) && brc >= 0 then
color.GREEN
else if isnaN(brc[1]) && brc < 0 then
color.RED
else if brc >= 0 && brc >= brc[1] then
color.GREEN
else if brc >= 0 && brc < brc[1] then
color.DARK_GREEN
else if brc < 0 && brc <= brc[1] then
color.RED
else
color.DARK_RED
);
brc.setLineWeight(5);

input mvgAvgLen = 6 ;
plot bma = average(brc,mvgAvgLen);
bma.assignValueColor(
if bma[1] > bma then color.RED
else if bma[1] < bma then color.GREEN
else color.LIGHT_GRAY
);
#plot bn = barNumber();﻿

## Friday, July 6, 2012

### amzn bull put vertical

So here's an example of my current trading chart and style:

 AMZN Weekly with seasonal projection.
The setup I am looking for is a liquid, triple-digit stock with a strong season coming up and is on-track for a repeat. The green arrow indicator is the PPS indicator and it is signaling a turn into the season. Then I want the stock to pull back into the body of the previous bar a little as AMZN did today.

The trade I took is called a bull-put vertical spread. I sold the August 220 put and bought the August 215 put simultaneously for a \$1.75 credit. This has a maximum risk of \$3.25 per spread and I put this spread on 3 times for a total risk of about \$1,000 and a total potential gain of about \$500 - a 50% return on risk.

The probability of success, if held to expiration, is about 60%:

I keep a limit order on to buy these back for 1/5 of the price I sold them, so I don't usually hold these into expiration.

## Thursday, July 5, 2012

### Still Here and Trading but New Work Situation

Hi smalldog fans,

Sorry that I've really slowed down on posts. I am still here, still trading but I have taken on a new work situation. So that means that I am not day-trading. Nor am I trading weekly options anymore. To give myself enough time to focus on new work activities I have shifted my focus to trading monthly options. In particular, I am concentrating on verticals and iron condors.

I've had a nice run (3) of winning trades utilizing Dan Sheridan's RUT Iron Condor, for example. If you have a funded account on TOS you can hear Dan explain this trade in the April 18 archived seminar. I do his trade trade 1/2 size and plan to add a contract leg after each \$2,000 profit, in keeping with the size to portfolio ratio of Dan's trade.

Additionally, I've been seeing better performance by focusing on weekly aggregation periods in my charts. Its a less noisy chart, the supports and resistances are more reliable, my seasonal projection is cleaner and the PPS indicator is fairly accurate for these weekly charts.

I've shared some of these trades on MyTrade but perhaps I plan to start a series of posts that show my weekly chart set-up and discuss how it helps support my trading decisions.

Best.
-Allen

## Thursday, May 31, 2012

### do away with the fed with the dow/gold ratio

hate the fed? if you want to see the market position corrected for all monetary interventions (and/or inflation) then look at the dow/gold ratio. here's a picture of what i'm talking about:

 5 year chart of the dow/gold ratio, weekly aggregation period.
the reason why this works is that the ratio tells you the value of the market in terms of a commodity that is an inherently stable store of value. gold reserves grow by roughly 2% a year and are not depleted much by industrial applications - very high percentages of all the the gold ever mined is still in circulation.

however, i do not endorse a gold standard. the reasoning i employ to come to this conclusion involves understanding why it was that the us gold standard was dropped. the basic overriding reason was that a gold standard potentially cedes control of the economy to foreign powers. if you have a real gold standard then you cannot then also prevent redemption. since the us currency is the reserve currency of the world then foreign countries are required to hold dollars. if foreign countries start redeeming their reserve dollars then this reduces the liquidity of the dollar thus pushing the dollar up in price. a strong dollar makes a recession worse by pricing us goods and services too high for export. the 30's depression, it is widely acknowleged, was made worse by france when france got nervous and redeemed dollars. france again began redeeming dollars in 1970 and president nixon, well studied in the depression economics, was quick to shut it down by shifting to a non-commodity standard, or fiat currency. from this viewpoint i would have to question the intelligence and/or loyalties of any politician that endorses a return to the gold standard.

here's how to create a dow/gold ratio chart on the thinkDesktop platform from td ameritrade.

## Saturday, May 19, 2012

### pay attention to the weekly chart with pps

last month was disappointing for me. let's just say that profits for the year have been eroded. that deserves no pity and i mention it only to 'splain why i have not posted for while. its been a period of soul-searching and self-doubt. i mean, how can i put my stuff out there without being a master of the universe!? so i have to remind myself that the blog is about sharing a learning experience and i am, after all, only a smalldog investor. alas, the learning experience involves hindsights, so here is what i have learned this month - pay attention to the weekly chart with pps!

here's a picture of what I'm talking about:

 weekly chart of spy with pps indicator
first of all, the weekly charts provide a cleaner view of the market for monthly spread trading. i am switching into a monthly spread trading style because i have some opportunities developing that will not allow me to watch the market intraday. even for intraday, it is my experience that support and resistance levels drawn from a weekly chart carry much more significance.

secondly, the pps (person's proprietary study, available in the free thinkdesktop platform from td ameritrade) indicator is the small up and down arrows. my observation is that if i had put on a vertical spread at the time and direction of the arrows i would have been generally happy with the results.  with hindsight, i certainly would have been better off had i at least used the circled arrow as an opportunity to close my longs (woulda, coulda, shoulda.)

john person, the proprieter of the pps study, does not disclose its workings (you can listen to john on the sept 28, 2011 recorded seminar.) there is speculation that pps measures this or that moving average crossover but jp has denied this. i prefer to think that pps is what is known as a feed-forward network. a feed-forward network is the static, non-learning, part of a neural network - it emulates the neural workings of a highly trained savant. if pps is a feed-forward network then it wouldn't help me to know its inner workings because it would be just a matrix of weighting numbers. in any case, it is my observation that pps does identify reversals sooner than most other indicators and i plan to weight it more heavily in my own neural network.

lastly, i am looking at weekly charts now because they work better with my seasonality studies, sdi_seapro5 and sdi_seapro7. the seapro (seasonal projection) studies plot the average seasonal move starting on a specified anchor date. the reason i think they work better on a weekly rather than a daily chart is because of calendar issues. you see, the number of trading days in a year can vary on the year (leap years have 253 bars, and weekends don't always fall on the same dates.) going back 252 bars on daily chart does not always get you back to the same, year-ago date on the calendar, just more-or-less the same date. also, the number of trading days per year varies by the product. futures and forex products do not take all of the holidays that the us stock market does, so they have 8 more trading days in a year, or 260, more or less. however, there are far fewer deviations from a 52 week trading year*, so it is a better comparison to average the performance of the weeks that are multiples of 52 ago.

so here's how my weekly chart looks with these seapro studies:
 weekly spy with pps and seasonal projections
the solid purple line is a projection of an average of the last five 52-week seasons anchored on the current week. the green line is the same projection anchored 10 weeks back. looking forward it looks like the market is on track to erase the gains for the year, retesting the 2011 close (blue dots from the sdi_yearclose study on sideline,) sometime in june. however, i would not be at all surprised, this time, if a green pps arrow appears and we bounce before june as this market has been surprising even the seasoned pro's, judging from what i hear on tastytrade.

*2007 had 53 weeks because the 53rd week began on december 31, according to the way tos delineates their weeks.

## Saturday, April 28, 2012

### thinkscript included: hiv delta

hiv delta is the difference between historical and implied volatility. implied volatility is a calculation of the underlying equity volatility based on the pricing of options. historical volatility is a calcuation of volatility based on the actual equity pricing over a recent period (20 bars by default.) if you are trying to decide if options are richly priced then you might want to compare the iv with hv. so the idea of my hivdelta study is to give you that comparison as a single histogram study instead of two separate line graphs. here's a picture of sdi_hivdelta in action:

 SPY Weekly Chart With sdi_hivdelta.
bright green bars represent where implied minus historical was greater than zero and increasing. dark green bars represent where implied minus historical was greater than zero and decreasing. vice-versa for the red/dark-red bars.

as an option trader i want to be selling options nearly most of the time. this is because i perceive theta-burn on the obligee side of the options contract to be a trading edge. occasionally i want to be a put buyer near a complacent market top. it looks to me like the red/green transitions are the times to be buying a put. what do you think?

here's the code:

#############
#sdi_hivdelta - difference between historical and implied volatility
#hint: plots the histogram of the difference between historical and implied volatility. the idea is that options are richly priced when iv exceeds hv and selling options is the more advantageous strategy. source:
http://www.smalldoginvestor.com rev: 1.0

declare lower;
input mode = { "histMinusImp", default "impMinusHist"};
#hint mode: select which way to perform the difference calculation.
input length = 20;
#hint length: number of bars to perform historicalVolatility calculation

def ihDelta = historicalVolatility(length)- impVolatility();

plot hid = if mode == mode.impMinusHist then -ihDelta else ihDelta;
hid.setPaintingStrategy(paintingStrategy.HISTOGRAM);
hid.setlineWeight(5);
hid.assignValueColor(
if hid < 0 and hid <= hid[1] then color.RED
else if hid < 0 and hid > hid[1] then color.DARK_RED
else if hid >= 0 and hid >= hid[1] then color.GREEN
else color.DARK_GREEN
);
#############

## Monday, April 16, 2012

### prodigio wiz file included: altucher's strategy

i hope this doesn't seem too obsessive but I have implemented altucher's simple strategy in prodigio. this strategy can be simply stated:
buy on 4 consecutive lower closes, sell on two consecutive higher closes
here's what this strategy looks like in prodigio:

 sdi_alt4down entry strategy

﻿﻿﻿﻿
 sdi_alt2up exit strategy
the multitude of boxes on the entry strategy are due to a mismatch in the capabilities of prodigio to implement this simple idea in a concise manner. in prodigio you basically have to tell it to compare today's close to yesterday's close and yesterday's close to the day before and so on til there are four comparison sequences. there does not seem to be a way to implement a counter for consecutive lower closes as one can do in thinkscript. but no matter, in thinkscript one cannot backtest a strategy like this against the entire s&p 100 for an entire year:

﻿﻿﻿﻿
 sdi_altucher equity curve when traded against s&p 100 for one year
these trades are each about 10,000 dollars of equity. the 150/81 win/loss ratio is excellent in my experience.

here's the prodigio statistics:

﻿
﻿
 sdi_altucher statistics for trading s&p100 for 1 year

﻿﻿
in prodigio i am only able to run the backtest 1 year back. in his presentation at the 2012 trader's expo in new york, altucher presented statistics on this strategy generated in fidelity's wealthlab-pro showing profits in every year going back to the late 1990's.

lastly i present the wiz file. this is an encrypted plain-text file that will implement the sdi_altucher strategy when imported into your prodigio platform. copy the text below and paste into a notepad file. then rename the extension of the file from .txt to .wiz and import into the wizard lab's strategy tab.

"sdi_altucher",VALID,STRATEGY,04/16/2012 18:32
-----BEGIN----
AAABAA3zKxoF36Pn9pFdzKwlko8nv9kA35LC0fgOSJQ9rMXRMlB/sK5MCQWnGfnO64vgZ+h8EcEb
iwYvCxra52BOJgtauMnyQY96XhWU/4G7mGHpRIIrEfxd2IRw3eQ8AYsRsh9In+8ljAVk+app20++
WtMIe7ZoMml12ZpMM9PybLlmCzUr2AK0TZ1DoVeQREJk7PAykZbtUvlp2/Pc3pwuTbW6SY/2MccX
VMWLqo1LlJo7zEi4jxbRzx5cKjqcpsCsEMm58knT6+BMrdtBIYylhqev0fD5z4xQIhmyYGzFtYyH
vOU0f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8n9kPk///7CtfHd
uetTDzchZqvAOPYlW30LoD4ah2ytM2Yu10V/jlL+1IYv8Jz7YXSeC+/PmjdKK7m4k5si/dkGkMPB
H9w4ERqiIjk0vFpJwRu96Y9PHkq6p3l8G8KUNF76I53MkU+4f/upCnBOEg==
-----END----

﻿﻿

## Saturday, April 7, 2012

### thinkscript included: altucher's strategy

during the trader's expo this year james altucher mentioned a simple strategy for trading the markets that he says has produced positive results almost every year for the last decade. in a nutshell, his strategy is:

buy on four consecutive lower closes, sell on two consecutive higher closes
this is a long-only strategy and it uses only market orders - really quite remarkable. so i thought i'd use altucher's strategy to explore the thinkorswim strategies facility.

thinkorswim strategies are the equivalent of what have come to be known as expert advisors. an expert advisor will help you map out how a strategy has performed in the past. the thinkorswim ea's will notate entries and exits on tos charts and keep a running tally of the hypothetical (they are only automated advice, not live trading) profit and loss. they are programmed in thinkscript.  here's what my ea for the altucher strategy looks like:
 spy with altucher's strategy, the p&l for the year is circled
sdi_altLE is where the strategy bought-to-open, and sdi_altLX is where the strategy sold-to-close.  this produced loss on spy but a small one considering that each trade is 100 shares - you didn't really think this would work all-the-time on any equity!? there's the rub, altucher's strategy works really well on a handful of equities and not so well on others. however, an ea can tell you in a flash which ones look rosey in the strategy's rearview mirror.

here's a more successful picture of the poster child, aapl:
 aapl with altucher's strategy
a nice gain but it completely missed the run-up this spring. the ~15% return on aapl is a bit underwhelming when compared to the 50% run-up. this underscores the boundaries of utility in the altucher strategy. it seems to do well with equities that are in favor but not trending. it will buy on weakness and sell into the rise, generally a good thing as most equities spend far more time treading water than making a big splash.

altucher gets crushed if the equity falls out of favor and starts trending down without a breather but not always. take a look how altucher fared on fslr:
 fslr with altucher strategy
fslr dropped from the 150's down to 20 and yet, this altucher strategy, trading only to the long side, produced a \$1800 gain, an unlikely feat of scalping the bounces in a down trend.

there are two scripts for my implementation of the altucher expert advisor, one for entry and the other for exit. also, you will need to create strategies, not studies. if you cut 'n paste the code be sure to click the strategies tab in the edit studies dialogue to create a new one.

############
# sdi_altLE - altucher strategy long entry.
#hint: buy to open at market after four consecutive lower closes. source: smalldoginvestor.com rev:1.0
def condition = close<close[1] && close[1]<close[2] && close[2]<close[3] && close[3]<close[4] ;
############

#############
#sdi_altLX - altucher strategy long exit.
#hint: sell to close at market after two consecutive higher closes. source: smalldoginvestor.com rev:1.0
def condition = close>close[1] && close[1]>close[2] ;
##############

## Monday, March 19, 2012

### bull signs

i am bullish on this market. i think we are about to see some shock and awe. here's why:

firstly, it is just the season for putting money to work in the markets. people are getting tax refunds and seeing good results as this quarter draws to a close. here's a seasonal projection of SPY:

the dark blue projection is a seven year seasonal average and is anchored 10 bars back. the purple and green projections are 5 year seasonal averages. the purple one is anchored on monday's close, while the green one is anchored 10 bars back. these 5 season projections are right on top of each other and trading above the 7 season projection. this tells me that the season is trending to higher values and we are on track for a repeat performance.

now the other signs that are figuring in my thinking are that utilities got whacked pretty hard last week. here's my favorite utility, ED, sucking wind:

there was a high-volume exodus from ED last week and the same pattern for utilities in general. utilities are where people hide out from the market in bad times because they are relatively stable and pay decent dividends (4.2% yield.)

furthermore, the treasuries took a drubbing last week too:

this all says to me that there is an exodus from the safe/defensive investments in these final weeks of the first quarter. i am placing my bet that this is a rotation into risk-assets. so hold onto your hats people.

## Sunday, March 11, 2012

### butterfly stroke

at the li swimmers meeting this saturday i initiated a discussion about a strategy that is called broken-wing butterfly. so i just wanted to rehash that here briefly.

first of all it is necessary to understand what a butterfly is, so here's the basic recipe: buy an option at strike 1, sell two of the same kind of options at the next higher strike, and, lastly, buy an option of the same kind at the next strike above the options sold.

here's how the standard butterfly looks on the equity we were referencing, gmcr:
 standard butterfly on gmcr

you can see that this is a low risk/high reward kind of trade but with low probability. one should expect to see these go out with a small loss most of the time. at the peak of the sweet spot centered on 60, there is the potential for profit of \$228 and the more likely loss limited to only \$17.

now to break a wing, we replace the most out-of-the money option purchased with the next further out-of-the money option. in the example above that would mean buying the APR12 65 CALL instead of the APR12 62.5 CALL. here's how this transforms the trade:

 broken-wing butterfly on gmcr

breaking the wing transforms this trade from low probability to high probability. at the peak of the sweet spot this bwb will produce \$268 of profit and the flat area below 57 is a \$22 profit. the trade off is that there is now a higher risk to the trade with max loss of \$228 occuring for prices above \$65.

these bwb's only tend to price for a credit like this when implied volatility has spiked. in this case news was released that starbucks was coming out with a single-serve coffee maker and this caused gmcr to gap down.  that you can trade these bwb's reactively like this is what appeals to me. the strikes were chosen to place the sweet spot at the top of the gap, the theory being that that this is where gmcr is likely to find resistance. furthermore implied volatility is likely to decline as gmcr rises into the sweet spot which helps develop profit in this trade. for this reason, i am not sure it is wise to trade the opposite, a broken-wing put-fly, in reaction to a gap up. it is likely that they would not have the IV spike to be initiated with a credit and the tendancy of IV to increase with declining prices would work against it.

## Friday, March 9, 2012

### a high-class problem

those of you who signed up to tastytrade via my referral link - i thank you greatly. however, this creates a high-class problem for me because tastytrade does not share your information. if you would kindly email me at support@smalldoginvestor.com i will reply back with the import files i promised.

best.
-allen

## Thursday, March 8, 2012

### nearly naked stock

one of the objections people have to selling calls against their stock is that if the stock starts to run-up then they get left spectating. this is unfortunate because equities only trend about 20-30% of the time. if you are not selling calls against your long stock then you are leaving money on the table and are most likely frustrated with the lack of profitability in range-bound trades.

i now have a new strategy, along the lines of my other nearly-naked strategies, that makes it so you can have your covered-call cake and eat it too by participating in up-trends.  the idea is simply this: buy a few more shares than you're selling calls against.

for example: purchase 150 shares of a stock you like and sell one 30-delta call option against it. now if the stock starts to move strongly above the strike of the call you still have 50 naked shares profiting in the run-up. you can let the 100 shares get called away thereby scooping profit off the table and manage the 50 naked shares as a runner, perhaps trailing a stop against it.

i am now doing this with the few equities that i own the shares of. usually these are high-dividend paying life hedges, such as ED, VZ and XOM. now you have no excuses - sell some covered calls.

_

## Thursday, February 23, 2012

### join tastytrade and get my thinkScripts

if you join tastytrade by following this link, thereby generating a referal bonus to me, then i will reward you back by sending you the import files for my portfolio of thinkScript studies (see chewToys.)

costs you nothing, gets you everything!

best.
-allen

note: if you do this please email me at support@smalldoginvestor.com so i can reply back with the import files - tastytrade does not share your information.

## Tuesday, February 14, 2012

### Edge Think

The other day I was listening to a trader, who runs a paid subscription blog, talk about his trading strategy on an internet show and my recent posts about edge guided me away from this particular person's strategy. So I thought I'd brain-dump on this a bit.

The strategy in question is highly acclaimed, by some, because it stays in-trade longer. Thus a winning trade is a big winner. The entry/exit strategy is indicator driven so there is not a pre-defined risk/reward. Well, that sounds great, sign me up. However, later on in the show, during a call-in period, a caller asked about his win/loss ratio. The reply given was that win/loss was not important but the average gain was 5 times the average loss.

Hmmm... He ducked the win/loss question and volunteered reward/risk instead. This excited my think-for-yourself circuitry. A reward/risk of 5 is really a risk/reward of 1/5 but he chose to present this information in its most favorable inversion. That in of itself is not indictable but he also declined to tell us an important piece of information that would enable a consumer to evaluate what sort of trading advantage he has achieved with the strategy, the win/loss ratio.

Rather than calling BS outright let's take a more generous interpretation of this behavior. Perhaps this trader is just not overly proud of the win/loss ratio because it is, maybe, a little too close to the break-even value of 1/5. His win/loss ratio has to be worse than flipping a coin, otherwise there would be such a huge edge to this strategy that he would already own his own island. So let's split the difference and guess that win/loss is perhaps, 3/5. Thus, his trading advantage is something like .15 (=3/8 * (3/5 - 1/5)), or an expected 15 cents return per dollar of risk. Which is actually pretty decent, if true.

However, I have trouble with any win/loss ratio that is less than one. This is because runs of luck in coin-flipping are well known and are expected to produce several runs of 6 or 7 in 100 tosses.  Now suppose you are tossing a rigged coin that favors heads, 5/3, and you are a tails caller. You should expect longer and more runs of heads than a fair coin.  I would quickly abandon a strategy if I were to get many losing trades and the strategy only has a statistical edge that is not well documented. Better yet, don't even adopt such a strategy. Then again, maybe that is just me and I have learned something about myself: I need to see many small wins to keep my confidence level high.

## Tuesday, February 7, 2012

### ThinkScript Included: MarketForecast With Overbought/Sold Lines

The MarketForecast is a proprietary indicator that many of us Investools and Prophet Chart students/users were eagerly awaiting to arrive in TOS Charts. Well, they are here, in the new MarketForecast study but if you are used to seeing the MFC on prophet charts or on the Investools website there is a glaring omission: no overbought/sold lines. If you want those lines you might attempt to use the price-level drawing tool to add them but you will have to draw them for every equity you chart. The lines need to be part of the study. I could send ThinkOrSwim a feature request email but it is easy enough for me to get the ob, os lines by writing my own study. So here's the image of the study:

 SPY, 1 month daily chart with sdi_mfc study.
Here's the code:

## Sunday, February 5, 2012

### Rolling-Up A Covered Call

A point of resistance to participating in covered-calls for many traders is the perception that once the price rises above the strike price you forego all further opportunity for profit. In my experience, for most equities, this is not true. First of all, one can always roll the call. Rolling is an operation whereby a trader buys back a soon-to-be-expiring call and sells an option at the same strike with more time-to-expiration. This is a standard operation and many brokerages, including ThinkOrSwim, can execute rolls in a single trade and usually for a credit on short-option rolls.

Where does that leave you? After rolling a covered-call, one is left with an in-the-money, short-option. This doesn't look good the first time you see it because it may have a small extrinsic value but here's a few points to be mindful of:
1. Higher potential gain. If you rolled for a credit then the new short-option will have its entry-price set up higher than the first initiating call you sold and this represents higher potential profit. Buy-back that rolled option for cents on the dollar and you definitely win.
2. Higher delta. Presumably one initiated the covered call out-of-the money which is always less than 50 delta. If you rolled an in-the-money call then the delta of the new short-option will be somewhere north of 50. Now, if the equity starts to slide then the gain in the new covered-call accumulates more rapidly than it would have in the originating call.
3. Direction rarely holds for very long. Most stocks zig-zag their way up due to profit taking.
4. You have all the time in the world. The shares you purchased don't expire so you can keep rolling the calls almost indefinitely.
These circumstances lead to opportunities to advance the strike price of a covered-call for little cost or even a credit. What one is looking for is a pullback after rolling the ITM call and preferably near the expiration of the new call. This pullback will produce a fat gain in the ITM call but your budget for rolling-up is the total of the accumulated roll-credits.

What we are looking to do is what is called a diagonal roll. We are seeking to roll our ITM call up in strike price and out in time. We are seeking to roll the call diagonally up for something like the accumulated roll-credits. If this up-diagonal prices, net of accumulated roll credits, for a credit or even a small debit (like a typical roll-value if you want to forward-invest the next roll credit, say) then it is worth the doing, because you lock-in the price differential of the strike prices in the underlying equity. Keep in mind that rolling diagonally down is almost always a steep credit and thus, easy. In this manner, given sufficient patience, it is almost always possible to advance the strike price of a covered call. Thus, there is a pathway to make money with covered-calls on the way up as well as down ... provided, of course, that the options of the underlying equity are relatively liquid.

Illiquidity is the gotcha to any option strategy. So be sure to choose an equity with liquid options - look at the front-month at-the-money options. The bid-ask spread should be no more than 10-20 cents. In the front-month there should be thousands of contracts of open-interest and triple digit open-interest in the ATM strikes. If not, then maybe don't trade the options. It hasn't always stopped me from selling covered-calls but I'm more willing to let the shares go if they go in-the-money.

## Sunday, January 29, 2012

### The Meaning Of Edge.

In my previous post I gave you the answer to the ultimate question of life, the universe and everything. No, not 42, but .046! This number represents the "edge" that a trader needs to achieve provided that she risks 2% of her account per trade and is willing to accept a 1% risk of ruin. But what does this edge mean?

I have been searching all over the web for this and there are some misleading perceptions out there over the meaning of edge. First of all, my use of the word is strictly with respect to the risk of ruin formula:
PR = ((1-Edge)/(1+Edge))^RiskUnits
In this usage, we see that Edge is a number between 1 and 0. This is because PR is a probability number that is constrained to be between 1 and 0 and values of Edge outside of that create illegal probabilities. Edge is an advantage that creates the expectation of making money so if your edge is negative you need to fade that strategy.

Consider the meaning of Edge=0. This produces a PR of 1, certainty, no matter how small you are trading because 1 raised to any power is still 1. It is clear that Edge=0 is an even-money result that over time will eventually produce ruination. If we are playing an even-money game such as betting on coin-flips then if we play long enough then we will eventually encounter a string bad luck (not necessarily in consecutive flips) that reduces our capital to the point where we have nothing left and have to stop playing.

Now consider this infinite coin-flip contest: we win 1.02 for a heads result and lose 1.00 for a tails result on a fair coin. We risk 1 to make 1.02 but our average win/loss ratio is 1. One should say that we have an edge of  1% because we now have the expectation of a 2 cent gain on 1/2 of the coin flips.

Suppose that the house in this coin-flip game wants to even things up by substituting an unfair coin. They wish to avoid detection by altering the coin by the smallest amount necessary. They only need make it so the win/loss ratio is 1/1.02. This is achieved by weighting the heads side so that the probability of a tails is .505. Thus in 1000 flips of that coin you would expect to see 495 heads paying almost 505 (504.9, to be precise) while the house collects 505 dollars on the tails outcomes. Thus #Wins/#Losses = Risk/Reward in an even-money game.

Thus edge can be mathematically defined as the win-rate times the difference between the Win/Loss ratio and the Risk/Reward ratio or:
Edge =  #Wins/#Trades  * ((#Wins/#Losses) - (Risk/Reward))
I find this particularly useful for my trading because I decree the Risk/Reward ratio by use of fixed stop and limit orders (or defined-risk option spreads.) Tracking the number of wins and losses is a simple matter of data collection.

Of course, average return per dollar of risk would also qualify as edge for the above risk of ruin calculation, too. This is because over a large number of trades one would come to expect this average in the future.

In one popular trading strategy (for which I am endlessly spammed) a limit order takes profit at 1.5 times the amount risked by a stop order. Yet, it is claimed that this wins about as many times as it loses. So I surmise from the claim that the edge of such a strategy is .167  (=.5 * (1-2/3)). We can then find out how many riskUnits we need  in order keep our risk of ruin low:
.01 = (1-.167)/(1.167)^RiskUnits
Plugging that into WolframAlpha because I am too lazy to solve for RiskUnits, tells me that I would need at least 14 times the amount risked, not including margin, in order to be able to trade that system safely.

## Saturday, January 28, 2012

### What Edge Do You Need?

I have been spending a bit of time pondering the risk-of-ruin (or as I will call it Probability Of Ruin so as not to confuse acronyms with return-on-risk) equation:
PR=((1-Edge)/(1+Edge))^RiskUnits

PR is a number between 0 and 1, where 1 is a virtual certainty and 0 is never-gonna- happen. Given the proper inputs, PR tells you what the probability is of blowing-out your account. You want to shoot for a PR under .1 and more ideally around .01-.02. That is to say if your PR is getting above 10% you need to reduce your trading size and if it is below 1% you are not earning as much as you might and should consider increasing your trading size.

When I was an InvesTools student I was taught not to risk more than 2% of account value on a trade. So this means that my RiskUnits are 50. Arbitrarily using .01 for the probability for PR, this morning's exercise is to work out what sort of trading Edge I need to stay out of trouble. Although, it is not possible to solve the PR equation explicitly for Edge, my son has introduced me to a website called Wolfram Alpha that can do an heuristic calculation based on these inputs without much fuss. The result I obtain is .046 or about 5%.

Check it out!

So what does Edge mean?

(TBC)

## Thursday, January 12, 2012

### ThinkScript Included: Display Duration Of Range Bars With sdi_barmin

I've been experimenting with the new TOS range bars. With the slow grind to the upside today I found myself expending more neuronal energy calculating how much time a given range bar took to complete than I cared to. So this was the inspiration for a new companion study for range bars: sdi_barmin

 SPY with Range Bars and sdi_barmin.

The lower study shows the duration in minutes of each completed range bar. Unfortunately it is not possible to show time accumulating in the forming bar with the current ThinkScript facilities (there is no access to the now-time from ThinkScript.)

Here's the ThinkScript:

#############################
# sdi_barmin
#hint: Plots the number of minutes a range bar took to complete Revision 1.0
http://www.smallDogInvestor.com
# author: allen everhart
# date: 1/12/2012
# Copyleft! This is free software. That means you are free
# to use or modify it for your own usage but not for resale.
# Help me get the word out about my blog by keeping this header
# in place.

declare lower;
def dif = secondsFromTime(0)[-1] - secondsFromTime(0) ;
def duration =
if dif >= 0 then dif/60 else (dif+(24*3600))/60
;
plot dur =  if !isnaN(close[-1]) then duration else double.NaN;

dur.setPaintingStrategy(PaintingStrategy.HISTOGRAM);
dur.setLineWeight(5);
#######################################