Click here to Login








TD Sequential Indicator

by Vangelis M., 4703 days ago
Share |






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);
td9dn=BarsSince(barssince(dn));

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

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(Perfbuy9,"B9",4,2,Belowlow,colorGreen,colorGreen,PlotSymbolCircle);
PlotSymbol(Perfsell9,"S9",4,2,Abovehigh,colorred,colorred,PlotSymbolCircle);

BLUE9BAR=BarsSince(td9dn==9 AND TD4dn);
TDSTRES= Ref(High,BLUE9BAR+8);
RED9BAR=BarsSince(td9up==9 and TD4up);
TDSTSUPP= Ref(Low,RED9BAR+8);

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

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


Share This ->
Share |


You have to log in to bookmark this object
What is this?
Additional Information




Type: Trading Indicator

Object ID: 1092


Country:
All

Market: All

Style:
Technical Analysis

Reviews
You must log in first

Join now
and get instant access for free to the trading software, the Sharing server and the Social network website.
Click here


Related objects

Empty

Number of reviews
Click to add a review
Average rate
Click to rate this item
Number of times this object was downloaded
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

Technical Analysis


Fundamental Analysis



Random Blog Posts

Custom Indicator: Moving average spread

The custom trading indicators tool explained

Diversify your portfolio by investing in stocks from various industries

Day Trading: A trading system that combines intraday and EOD data

Intermarket Analysis - Correlation and Trading Strategies

How to choose which technical indicators to use in your trading system

4 indicators to create adaptive trading systems

How to create buy and sell trading rules based on News Data

Show All

Number of reviews
Click to add a review
Average rate
Click to rate this item
Number of times this object was downloaded
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






QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.