Get Updates:
Email
Twitter
RSS

You’ll be happy to know that today’s release squashed a particularly troublesome EMA initialization bug. This is welcome news for those who use either the Vervoort Crossover or Heikin-Ashi Candlestick Oscillator as these use triple exponential moving averages and were negatively impacted by the bug. Thanks to the Thinkorswim team for hunting these down.

Here’s a Sunday afternoon quickie for my loyal readers. While playing with some of the recently added new toys in thinkScript, I build this quick study that displays the Advance Decline Ratio or Advancing-Declining Issues in a little box at the upper left. You can select if you want the A/D Ratio or A-D Issues in the study properties panel. I set the coloring up such that the box is red if the value has worsened from the previous bar or green if it has improved. As with all indicators which pull the $ADVN and $DECN data, it will not work on TICK charts. Best of luck trading in the new year! – Eric

Advance Decline Box


# TS_AdvanceDeclineBox
# thinkscripter@gmail.com
# Last Update 03 JAN 2010

def A = close("$ADVN");
def D = close ("$DECN");
def ADL = A - D;
def ADR = if A > D then A / D else -D / A;
input mode = {default Ratio, Issues};
def modeSwitch = if mode==mode.Ratio then 1 else 0;

AddChartLabel(yes,
if modeSwitch then ADR else ADL,
if modeSwitch then ":1 A/D RATIO" else " A/D LINE",
if modeSwitch then if ADR > ADR[1] then color.green else color.red else if ADL > ADL[1] then color.green else color.red);
plot null = double.nan;

Heads up to all that there is a bug in the current builds of TOS that affects the initialization of exponential moving averages. Beginning with the December builds, TOS changed the way exponential moving averages were initialized. I will spare you the details of what I have found but it is a real PITA. The Vervoort Crossover and Heikin-Ashi Candlestick Oscillator studies are most affected since they use a triple exponential moving average. The leftmost part of any chart with these studies will be completely incorrect. As time progresses, the “Bad Data” is worked out and the indicators normalize. For the time being I recommend you do not use these studies. If you are compelled to then plot a much longer timeframe than you need to allow everything to settle out. Here is a picture of the Vervoort Crossover study and the wild swings early on in the chart. TOS is aware of the bug.

Exponential Average Bug

…You should. Here’s a nice place to start:
http://market-ticker.org/archives/1802-MOVE-YOUR-MONEY.html

In trading we constantly check to see if volume is confirming price. Rising price accompanied by falling volume is often the signal for an impending reversal. The Volume Trend plots the linear regression of the volume for the user specified last number of bars. The color of line reflects the slope – green for rising and red for falling. The Price Trend is a similar linear regression line. In this case, the line is colored blue if the price and volume are of diverging slopes and white else wise. Both indicators will automatically update with each bar. Also pictured is the revised AutoFibLines script. It is completely functional again and now has the added benefit of working on Forex pairs and other symbols trading down in the decimal range. Also added were a reversal dot indicating at what closing price the AutoFibs will reverse direction and update the fib levels as well as a trend direction arrow indicating in which direction the fibs have been drawn. PS: The ToS Script Editor is happy with cutting and pasting from the web again! :)

Volume and Price Trend

Volume and Price Trend

# TS_VolumeTrend
# http://www.thinkscripter.com
# thinkscripter@gmail.com
# Last Update 16 Dec 2009

declare fullrange;
declare on_volume;
declare real_size;

input period = 50;

plot VolTrend = InertiaAll(volume, period);
def volumeSlope = if voltrend>voltrend[1] then 1 else 0;
VolTrend.assignValueColor(if voltrend>voltrend[1] then color.green else color.red);
VolTrend.setLineWeight(2);

# TS_PriceTrend
# http://www.thinkscripter.com
# thinkscripter@gmail.com
# Last Update 16 Dec 2009

declare fullrange;

input price = close;
input period = 50;
def offset = 100;

def linearPriceTrend = InertiaAll(close, period);
def priceSlope = if linearPriceTrend>linearPriceTrend[1] then 1 else 0;
def dist = HighestAll(AbsValue(linearPriceTrend - price)) * (offset / 100.0);

def VolTrend = InertiaAll(volume, period);
def volumeSlope = if voltrend>voltrend[1] then 1 else 0;

plot PriceTrend = if priceSlope==0 then linearPriceTrend-dist else if priceSlope==1 then linearPriceTrend+dist else linearPriceTrend;
PriceTrend.assignValueColor(if volumeSlope != priceSlope then color.blue else color.white);
PriceTrend.setLineWeight(2);

« Newer Posts - Older Posts »