#twitter-follow { border: 0;position: fixed; top: 240px; left:0;} #live-support { border: 0;position: fixed; top: 370px; left:0;} #knowledge-base { border: 0;position: fixed; top: 170px; left:0;}

## TD Sequential Indicator

by Vangelis M., 4347 days ago

This function implements Thomas DeMark's TD Sequential Indicator. There are many different versions of this indicator with different rules and many nuances. Not all are implemented here. For more detail you should add to the code.

This function accepts two arguments, a number and a string.

TDSequential(0,"") - Returns the count of the Setup phase. Returns 1 to 9 for a BuyCount and -1 to -9 for a SellCount. Returns "99" (or "-99") for a "perfected" "9".

TDSequential(1,"Sequential") - Returns the Sequential countdown after the setup is complete. Positive number for a Buy count, negative for a sell count. At count 18 (or -18) it resets and stops counting until the next setup.

TDSequential(1,"Combo") - Returns the Combo version countdown.

After you download the TD Sequential function you use it in an indicator formula to visualize it.
Here's an example (copy and paste to an indicator formula):

//---------------------------------start
PlotCandleStick("Quotes", colorBrown|255|colorViolet|255|0, StyleSymbolVdash);

TDSetup=TDSequential(0,"");
TDSeq=TDSequential(1,"Sequential");

PlotSymbol(TDSetup>0 and TDSetup<10,TDSetup,2,1,Belowlow,colorBlue,colorBlue,PlotSymbolNone);
PlotSymbol(TDSetup<0 and TDSetup>-10,-TDSetup,2,1,AboveHigh,colorRed,colorRed,PlotSymbolNone);
PlotSymbol(TDSeq>0 and TDSeq!=ref(TDSeq,1),TDSeq,0,5,Belowlow,colorBlue,colorGreen,PlotSymbolNone);
PlotSymbol(TDSeq<0 and TDSeq!=ref(TDSeq,1),-TDSeq,1,5,AboveHigh,colorBlue,colorOrange,PlotSymbolNone);

PlotSymbol(TDSetup==99,"B9",4,2,Belowlow,colorblue,colorblue,PlotSymbolCircle);
PlotSymbol(TDSetup==-99,"S9",4,2,Abovehigh,colorred,colorred,PlotSymbolCircle);

PlotSymbol(TDSeq==13 and TDSeq!=ref(TDSeq,1),"13",4,2,Belowlow,colorGreen,colorGreen,PlotSymbolCircle);
PlotSymbol(TDSeq==-13 and TDSeq!=ref(TDSeq,1),"13",4,2,Abovehigh,colorred,colorred,PlotSymbolCircle);
//-------------end

If you are looking for just the Setup phase or the Demark's Support Resistance Lines,
HERE'S AN ALTERNATE CODING USING VECTOR LANGUAGE ONLY:
//--------------------start
PlotCandleStick("Quotes", colorBrown|255|colorViolet|255|0, StyleSymbolVdash);
dn=Iff( close < ref(close,4),1,0);

up=Iff( close>ref(close,4),1,0);

PlotSymbol(td9dn>0 and td9dn<10,td9dn,2,1,Belowlow,colorBlue,colorBlue,PlotSymbolNone);
PlotSymbol(td9up>0 and td9up<10,td9up,2,1,AboveHigh,colorRed,colorRed,PlotSymbolNone);

TD4dn= Ref(Close,9)>=Ref(Close,13);
TD4up= Ref(Close,9)<=Ref(Close,13);
Perfbuy9=td9dn==9 AND TD4dn and LLV(Low,2) < Ref(Low,2) AND LLV(Low,2)< Low < Ref(Low,3);
Perfsell9=td9up==9 and TD4up and HHV(High,2) > Ref(High,2) AND HHV(High,2)> High < Ref(High,3);

PlotSymbol(Perfsell9,"S9",4,2,Abovehigh,colorred,colorred,PlotSymbolCircle);

TDSTRES= Ref(High,BLUE9BAR+8);
TDSTSUPP= Ref(Low,RED9BAR+8);

plot(TDSTRES,'TDRes',colorOrange,ChartLine,StyleDashed);
plot(TDSTSUPP,'TDSTSUPP',colorgreen,ChartLine,StyleDashed);

//----------------end

What is this?

 Type: Trading Indicator Object ID: 1092 Country: All Market: All Style: Technical Analysis

 Related objects Empty
Number of reviews
Average rate
Click to rate this item
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object

Number of reviews
Average rate
Click to rate this item
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object