What's New

Video Screencast #3: Variables (Part 2)

This week’s video continues the discussion of variables and into the topic of recursion. The compoundValue function is also explained and its use with the rec statement.

First Half:

Second Half:

Posted in Tutorial | Tagged , , , , , , , , , | 4 Comments

Video Screencast #2: Variables (Part 1)

After working though some issues last week, I think I’ve got the screencast process ironed out. In this week’s video I begin to explore the topic of variables in thinkScript. It is a lengthy topic and will be continued in the next tutorial. Thank you all for the kind words and suggestions for follow-on topics. Still playing catch up on emails so I really appreciate your patience. -Eric

First Half:

Second Half:

Subscribe in iTunes!

Posted in Tutorial | Tagged , , , , , , | 2 Comments

Video Screencast #1: Getting Started with thinkScript

Well I finally got off my duff and recorded what I hope to be the first in a series of video screencasts devoted to learning and exploring the thinkScript language. This one is very basic and details the very first steps to importing or building your first study. I haven’t quite settled on how I’m going to host the videos so it’s blip.tv for now. I’m interested to hear your thoughts and ideas for follow on topics. -Eric

Subscribe in iTunes!

Full quality Quicktime version available HERE.

Posted in Tutorial | Tagged , , , , , , | 10 Comments

Custom Columns – Bollinger Band Excursion %

I often get requests for custom column codes for the MarketWatch Quote tab in TOS. Pro Member Dennis requested something to identify stocks that are outside of their Bollinger Bands and specifically the 15 minute, 60 minute, and daily timeframes. The exercise is fairly easy if you are familiar with the custom column coding technique so I thought I’d throw together a quick tutorial for reference.

1) On the MarketWatch Quote tab click the very nondescript gray circle next to Symbol and chose Customize…

2) In the Customize Quotes dialog chose one of your unused custom formulas and click on the script icon with the lock.

3) Add code for your custom column definition, change the name to something suitable, choose your aggregation period, and set any study parameters required. Clicking on one of the pre-defined study names in the code window will bring up its parameters in the section on the right. (I repeated this same process for the 60 and daily aggregation periods as well)

4) Add your new custom columns to your layout.

The custom columns are now in your Quote page. You can sort various columns by clicking in the header.

Here is the code snippet used in the custom column definition. The custom column expects a single plot and its value is returned into the column. You can apply a custom background or font color as well. In this case I have colored the background red when the close has exceeded the upper Bollinger Band and green when below.

def closeAbove = close-BollingerBandsSMA().UpperBand;
def closeBelow = BollingerBandsSMA().LowerBand-close;
plot result = if closeAbove > 0 then (closeAbove/close)*100 else if closeBelow>0 then (closeBelow/close)*100 else 0;
assignBackgroundColor(if closeAbove>0 then color.red else if closeBelow>0 then color.green else color.current);
result.assignValueColor(if closeAbove > 0 or closeBelow > 0 then color.black else color.current);
Posted in Tutorial | Tagged , , , | 8 Comments

Option Spread Viewer

My primary trading focus is options and the thinkorswim platform is outstanding in this regard. However, I wanted a way to graphically depict the value of an option spread on my charts. I was particularly interested in watching the weekly options in high beta stocks like AAPL. In general, I try to avoid trading options during expiration week and prefer to sell theta 3-4 weeks prior to expiration. However, after experimenting with weekly options over the past few weeks, I see some intriguing opportunities.

The Option Spread Viewer allows you to display option spreads of up to four different contracts or as few as one (i.e. a single naked contract). You must enter the individual contract symbols and a multiplier for each contract (e.g. .AAPL110225C360 with a multiplier of -1 means short one AAPL 360 call). There are three display modes: Contract Cost shows the aggregate contract cost for the spread; Spread Value shows the dollar value of the spread; Bar Percent Change shows the percent change in the spread from one chart bar to the next. The user has the option to display an entry price in the Contract Cost mode which will be plotted across the chart for reference. The image below shows three examples of the Option Spread Viewer in each of the modes.

This study will be published in the Pro Member’s update tomorrow 27 Feb. Good luck in your trading – Eric

Option Spread Viewer

Posted in Indicator | Tagged , , , | 23 Comments