1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. New memberships are no longer available.

thinkorswim TICK + TRIN 10/26/15

Combination TICK and TRIN indicator to save screen space.

  1. Eric Purdy
    I’ve taken the original TICK indicator and gone a few steps further. The plot more closely resembles a bar chart now and the bars are colored based on three options. First you can color the bars based on the slope of the nine period EMA of the TICK. Second you may color the bars based on whether that same nine period EMA is above or below the zero line as pictured below. Lastly, you can color any bars where the range of the TICK readings is greater than an input threshold. These bars are magenta and they provide an extreme volatility warning of sorts. Note that if you use this on a larger timeframe, you’ll probably want this option off. As before, extreme TICK readings are flagged with a yellow triangle also based on user-defined threshold values. The highest high TICK and lowest low TICK are indicated by the dashed lines in the extreme region. Lastly, the centerline of the indicator changes color based on the trend of the TRIN indicator. There are two methodologies for detecting the trend to choose from.

    As with any study, you can turn on and off the parts of the indicator you would like to see in the control panel. tickplustrin.png

Recent Reviews

  1. zkendrick123
    Version: 10/26/15
    Study is incorrectly written. The Trinline is green when it should be red and vice versa. Switch them and then it's fine.
    Also, Trin doesn't work well. Use ADSPD instead.


    declare lower;

    input highExtreme = 1000;

    input LowExtreme = -1200;

    input emaPeriod = 2;

    input wideRangeThreshold = 1600;

    input bar_coloring = {default EMA, EMA_TREND};

    input colorWideRangeBars = YES;

    input trinMethodology = {default SMA_Slope, Trend};

    def tick_h = high("$TICK");

    def tick_l = low("$TICK");

    def tick_c = close("$TICK");

    def tickAve = ExpAverage((tick_h + tick_l + tick_c) / 3, emaPeriod);
    def tickAve9 = MovAvgWeighted((tick_h + tick_l + tick_c) / 3, 9, 0);

    def extremeBar = if AbsValue(tick_h - tick_l) > wideRangeThreshold
    then 1 else 0;

    def comparator = if bar_coloring then tickAve9[1] else 0;

    def newDay = if(getDay() > getDay()[1], 1, 0);

    rec highTick = if(!newDAy and tick_h > highTick[1], tick_h,
    if(IsNaN(tick_h) or newDAy, 0, highTick[1]));

    rec lowTick = if(!newday and tick_l < lowTick[1], tick_l,
    if(IsNaN(tick_l) or NewDay, 0, lowTick[1]));

    plot HighestTick = highTick;


    plot LowestTick = lowTick;





    plot zero = 0;

    plot midH = 600;

    plot midL = -600;

    plot extH = highExtreme;

    plot extL = LowExtreme;

    plot tickClose = tick_c;


    tickClose.AssignValueColor(if tick_c > 0 then color.cyan else color.orange);

    plot EMA = tickAve;



    plot EMA9 = tickAve9;



    def trin_h = high("$ADSPD");

    def trin_l = low("$ADSPD");

    def trin_c = close("$ADSPD");

    def secondBarClosed = if(IsNaN(trin_c[-2]), 0, 1);
    def thirdBarClosed = if(IsNaN(trin_c[-3]), 0, 1);

    def triggerDown = if(trin_c[-1] < trin_c, 1, 0);

    def triggerUp = if(trin_c[-1] > trin_c, 1, 0);
    def secondBarDownConfirmation = if(secondBarClosed and trin_c[-2] <
    trin_l[-1], 1, 0);

    def secondBarUpConfirmation = if(secondBarClosed and trin_c[-2] >
    trin_h[-1], 1, 0);

    def thirdBarDownConfirmation = if(thirdBarClosed and trin_c[-3] <
    trin_l[-1], 1, 0);

    def thirdBarUpConfirmation = if(thirdBarClosed and trin_c[-3] >
    trin_h[-1], 1, 0);

    def Sell = if(triggerDown and (secondBarDownConfirmation or
    thirdBarDownConfirmation), 1, 0);

    def Buy = if(triggerUp and (secondBarUpConfirmation or
    thirdBarUpConfirmation), 1, 0);

    rec upDownSwitch = if(Sell, 1, if(Buy, 0, upDownSwitch[1]));

    plot extreme = if(tick_h > highExtreme, tick_h, if(tick_l <
    lowExtreme, tick_l, double.nan));



    def trinAve = Average(trin_c, 3);

    def slope = if(trinAve > trinAve[1], 1, 0);

    plot trinLine = if(!isNan(close),0, double.nan);
    trinLine.AssignValueColor(if trinMethodology then if upDownSwitch[1]
    then color.RED else color.GREEN else if slope then color.GREEN else


    plot backGround = if tick_l > 0 then tick_l else if tick_h < 0 then
    tick_h else double.nan;



    plot HT = tick_h;
    HT.AssignValueColor(( if !extremeBar and tickAve9 > comparator then
    color.green else if extremeBar and colorWideRangeBars then
    color.magenta else color.dark_red));


    plot LT = tick_l;
    LT.AssignValueColor(( if !extremeBar and tickAve9 > comparator then
    color.dark_green else if extremeBar and colorWideRangeBars then
    color.magenta else color.red));