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:
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:
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:
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
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);