TD Sequential
Forums › ProRealTime English forum › ProOrder support › TD Sequential
- This topic has 42 replies, 8 voices, and was last updated 6 years ago by grimweasel47.
-
-
07/30/2017 at 6:34 PM #42024
Hi’ guys,
I’ve been looking for a TD Sequential code for ProReal some time, but without luck. Hence, I started to code it myself… but I must admit that since then my understanding of the TD sequential has expanded. I already see, that adding TDST support and TD countdown will be difficult for me as I have to store it. I’ve found this code on MetaTrade, which would be useful, if someone can help convert it.
I think, I got the TD Setup correct, but missed the TD flip prior to it. Further, I need to:
- Add TDST support/resistance lines
- Add TD Countdown both for buy and sell
- Add TD Countdown perfection signal
- Add actual buy/sell signal
TD Sequential123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158DEFPARAM CUMULATEORDERS = FALSE//DEFPARAM FLATBEFORE = 080000DEFPARAM FLATAFTER = 230000//indicatorsIndicator1 = Volume//Buy Conditionsb0 = Indicator1 > 500// Detection of TD Setup buy signalb1 = Close < Close[5] AND Close [2] < Close[6] AND Close[3] < Close[7] AND Close[4] < Close[8] AND Close[5] < Close[9] AND Close[6] < Close[10] AND Close[7] < Close[11] AND Close[8] < Close[12] AND Close[9] < Close[13]// Detection of TD Setup buy signal - perfectionb2 = Close OR Close[2] < Low[6]b3 = Close OR Close [2] < Low[7]// TD Countdown (Buy)b4 = 0For ****BuyConditions = b0 AND b1 AND b2 AND b3 AND b4// Conditions to enter long positionsIF NOT LongOnMarket AND BuyConditions THENBUY 1 CONTRACTS AT MARKETENDIF// Conditions to exit long positions//If LongOnMarket AND YourConditions THEN//SELL AT MARKET//ENDIF// ***** Short Conditions *****s0 = Indicator1 > 500// Detection of TD Setup Sell signals1= Close < Close[5] AND Close [2] > Close[6] AND Close[3] > Close[7] AND Close[4] > Close[8] AND Close[5] > Close[9] AND Close[6] > Close[10] AND Close[7] > Close[11] AND Close[8] > Close[12] AND Close[9] > Close[13]// Detection of TD Setup Sell signal - perfections2 = Close OR Close[2] > Low[6]s3 = Close OR Close [2] > Low[7]// TD Countdown (Sell)s4 = 0For i=0 ****ShortConditions = s0 AND s1 AND s2 AND s3 AND s4// Conditions to enter short positionsIF NOT ShortOnMarket AND ShortConditions THENSELLSHORT 1 CONTRACTS AT MARKETENDIF// Conditions to exit short positions//IF ShortOnMarket AND YourConditions THEN///EXITSHORT AT MARKET//ENDIF// Stops and targets : Enter your protection stops and profit targets hereSET TARGET PPROFIT xxSET STOP PLOSS xx// **** Stops and targets ***//DYNAMIC TRAILING STOPmyATR = averagetruerange[14](close)TGL =1*myATR //DYNAMIC TRAILINGTGS=13*myATR //DYNAMIC TRAILINGif not onmarket thenMAXPRICE = 0MINPRICE = closePREZZOUSCITA = 0ENDIFif longonmarket thenMAXPRICE = MAX(MAXPRICE,close)if MAXPRICE-tradeprice(1)>=TGL*pointsize thenPREZZOUSCITA = MAXPRICE-TGL*pointsizeENDIFENDIFif shortonmarket thenMINPRICE = MIN(MINPRICE,close)if tradeprice(1)-MINPRICE>=TGS*pointsize thenPREZZOUSCITA = MINPRICE+TGS*pointsizeENDIFENDIFif onmarket and PREZZOUSCITA>0 thenEXITSHORT AT PREZZOUSCITA STOPSELL AT PREZZOUSCITA STOPENDIF//TRAILING STOP//trailingstop = t2// * resetting variables when no trades are on market//if not onmarket then//MAXPRICE = 0//MINPRICE = close//priceexit = 0//endif// *case SHORT order//if shortonmarket then//MINPRICE = MIN(MINPRICE,close) //saving the MFE of the current trade//if tradeprice(1)-MINPRICE>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then//priceexit = MINPRICE+trailingstop*pointsize //set the exit price at the MFE + trailing stop price level//endif//endif// *case LONG order//if longonmarket then//MAXPRICE = MAX(MAXPRICE,close) //saving the MFE of the current trade//if MAXPRICE-tradeprice(1)>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then//priceexit = MAXPRICE-trailingstop*pointsize //set the exit price at the MFE - trailing stop price level//endif//endif// *exit on trailing stop price levels//if onmarket and priceexit>0 then//EXITSHORT AT priceexit STOP//SELL AT priceexit STOP//endif// DONCHIAN STOP//IF LONGONMARKET THEN//DC= s1//ENDIF//IF SHORTONMARKET THEN//DC= s2//ENDIF//e= Highest[DC](high)//f=Lowest[DC](low)//if longonmarket then//laststop = f[1]//endif//if shortonmarket then//laststop = e[1]//endif//if onmarket then//sell at laststop stop//exitshort at laststop stop//endifIn addition, I am trying to test which stop/profit formula would be best including a dynamic trailing. Ideally, the stop level should be slightly lower than the TDST support.
I would also highly appreciate view of others on Demark indicators and the performance hereof in day trading.
Looking forward to your suggestions.
08/10/2017 at 11:11 AM #4286708/10/2017 at 12:26 PM #4290208/10/2017 at 2:28 PM #42931What I like about the indicators from DeMark is the timing signal. E.g. on a trend reversal….however, there are many rules to look for.
See following links: This article or this blog.
or the best link (which I am following to produce the code): here
The book describes the indicators available on Bloomberg among few other platforms. If we can get these indicators coded for ProReal, I think it would be powerful. Hope to see more interest or opinions on why it is not a good indicator.
09/21/2017 at 9:11 PM #46865Hi Baaz,
Yes! DeMark sequential is a really powerful indicator – if you can crack it that would be really awesome.
Could you write the code just to show the green 9s & red 13s?
I’d like to keep in touch and follow your progress.
this guy is a great source of knowledge on DeMark
09/21/2017 at 10:53 PM #4686609/21/2017 at 10:58 PM #46867That’s awesome despair. Be great to see it on PRT.
The basic definitions that I have are:
From Jason Perl Book book
TD Setup
The prerequisite for a TD Buy Setup is a Bearish TD Price Flip, which
indicates a switch from positive to negative momentum.
Bearish TD Price Flip
A Bearish TD Price Flip occurs when the market records a close greater than the
close four bars earlier, immediately followed by a close less than the close four bars
earlier.
TD Buy Setup
After a bearish TD Price Flip, there must be nine consecutive closes, each one less
than the corresponding close four bars earlier.
If, at any point, the sequence—of nine consecutive closing prices less
than the closing price four bars earlier (up to and including the close of
TD Buy Setup bar nine)—is interrupted, the developing TD Buy Setup
will be canceled and must begin anew.
TD Setup vs. TD Sequential countdown
Once TD Setup is complete,TD Countdown can begin, from the close
of bar nine of TD Setup (inclusive), onward.
The distinction between the two strategies is this:
- TD Setup compares the current close with the corresponding close
four bars earlier,
Whereas
- TD Countdown compares the current close with the low two bars
earlier for a potential buy, and compares the current close with the
high two bars earlier for a prospective sell.This price relationship is
an important distinction from TD Setup, because the market must
be trending for TD Countdown to objectively identify the likely
exhaustion point for a trend reversal.
One can start looking for the first bar of a TD Buy Countdown
when a TD Buy Setup is in place.
To Initiate TD Buy Countdown
After
TD Buy Setup is in place, look for the initiation of a TD Buy Countdown.
If
Bar nine of a TD Buy Setup also has a close less than, or equal to, the low two bars
earlier,
Then,
Bar nine of a TD Buy Setup becomes bar one of a TD Buy Countdown.
If
That condition is not met,
Then
TD Buy Countdown bar one is postponed until it does, and the TD Buy Countdown
continues until there are a total of thirteen closes, each one less than, or equal to,
the low two bars earlier.
& then I guess it’s the opposite for sell setups.
Are you interested in trading off the countdowns or will you just use it to highlight potential trades?
09/21/2017 at 11:00 PM #4686809/22/2017 at 7:53 AM #4687809/22/2017 at 10:47 AM #4690709/22/2017 at 1:01 PM #46925So far it doesn’t look that promising. Also the informati0ns at the different links you send are varying a little bit. None makes useful points where to put the SL in all cases. None mentions profit targets either. So I tried a trailing stop.
Then I found no reference to which timeframe this is supposed to run on. If I look at the links they show daily charts but on daily charts it doesn’t work at all. On 1h-chart I get some results but also nothing really exciting. Probably one has to read the book to get all information.
Another aspect is that this setup needs really long time to build. The first TD Setup needs 9 bars and generates trades but the second TD countdown doesn’t generate a single trade for me and well honestly it would take at least 22 bars to build (can be much longer for the countdown).
09/22/2017 at 1:13 PM #4692709/22/2017 at 1:19 PM #4692809/22/2017 at 1:37 PM #46936Hi Despair,
The indicator should work over any timeframe, I have definitely seen it work on hourly, daily & weekly.
This is a link to the jason perl book
He talks about the risk management for the setups around page 62, hth.
I’m going to try & add a couple of screenshots with the demark indicators from a Bloomberg screen, the etf XLP and the DXY index
09/22/2017 at 1:43 PM #46954It’s not really a black box indicator setting rigid profit tgts, I think the most successful traders use it a confirmatory tool alongside their own risk management/sizing criteria.
If you can get the setup & countdown 9s & 13s to work that would be awesome & I will ask a few of the traders I know if they use any specific S/L & profits tgts when they trade with it.
-
AuthorPosts
Find exclusive trading pro-tools on