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.
-
-
09/22/2017 at 1:55 PM #46955
I have the setup working but it doesn’t produce good results on any TF I tested. The TD countdown doesn’t generate any trades at all. I can forge it into an indicator so you can play around with it yourself.
However thank you very much for the book! I will have a look into it.
09/22/2017 at 2:56 PM #46963Here you find the indicator:
09/22/2017 at 6:55 PM #4699809/22/2017 at 7:05 PM #4699909/22/2017 at 7:12 PM #47003That’s the bit I don’t understand, I get a newsletter from Tom Thornton & from his Bloomberg DeMark screener
Here are stocks that currently have triggered 13’s on the countdown today….
DAILY UPSIDE 13: AES, APD, HCSG, IRM, SHLM, WPX, XEC
DAILY DOWNSIDE 13: APOG, ESRX, LEN, LPNT, THS
So I don’t understand why your code has not highlighted them.
If it’s an indicator they should be visible?
09/22/2017 at 7:17 PM #47004@Despair… don’t despair. 🙂
Maybe you can show some screenshots? I agree, the number of identified trades would be low, but they will be there. Which instrument did you test?
As a sample, I’ve put in a TD Setup combined with Engulfing, which I am running in the Demo environment for some weeks now. The low amount of trades is due to my “over optimization”. I believe, if we by using countdown can time the “reverse” trading more accurately and with TDST support/resistance as SL and targets… it will be powerful.
09/22/2017 at 8:29 PM #4700809/22/2017 at 9:38 PM #47019Naaaaice work… will run it over the weekend. Thank you Despair for programming this!
09/23/2017 at 3:06 PM #4706709/23/2017 at 5:01 PM #47083The code must be reviewed by Nicolas before it pops up in the library. But if you look here:
https://www.prorealcode.com/topic/td-sequential-setup/
You will find the code for download (scroll all the way down for the latest version).
I always post indicators in the probuilder forum and not here in proorder.
09/23/2017 at 11:03 PM #4709103/12/2018 at 12:50 PM #6505203/12/2018 at 1:28 PM #6505404/17/2018 at 10:57 PM #68637Hi’ guys,
Some feedback on this topic. I’ve tested the code written by @Despair with a slight modfication, where I added: Bullish Engulfing, Aroon Up/Down and volume. Further, I tried to add the Support and Resistance lines as defined by Demark, but without any luck – hence code is disabled. Also, I added some exit conditions.
It started out very well for the first three months, but then the performance worsened. Pictures added.
However, I still see a potential in it…so maybe we can collaborate around an enhanced version, where we add:
- Support and Resistance lines as defined by Demark and ensure the TDemark setup only triggers if the price stays within these lines
- Add enhanced 2nd and 3rd “confirming” signals
- Add improved exit conditions, profit and SL
Code is here:
TDemark DAX 1m123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317//-------------------------------------------------------------------------// Main code : TDemark_DAX v2 1m//-------------------------------------------------------------------------DEFPARAM CUMULATEORDERS = FALSE//DEFPARAM FLATBEFORE = 080000//DEFPARAM FLATAFTER = 230000/////****** TDE SETUP / COUNTDOWNonce TDSL=0once TDSS=0once BuySetup=0once SellSetup=0Once BuyCountdown=0once SellCountdown=0Once BuyConditionTDSetup = 0Once BuyConditionTDSetup = 0Once BuyConditionTDCount = 0Once ShortConditionTDCount = 0if close[1]>close[5] and close<close[4] thenbearishflip=1bullishflip=0elsif close[1]<close[5] and close>close[4] thenbullishflip=1bearishflip=0endifif close<close[4] and bearishflip thenTDSL=TDSL+1TDSS=0elsif close>close[4] and bullishflip thenTDSS=TDSS+1TDSL=0endif//if TDSL>0 and TDSL<10 then//SetSellLimit1 = Lowest[TDSS](price)//TDSTSupport = Lowest[TDSS](Close) //drawtext("#TDSL#",barindex,low-10*pipsize) coloured(0,255,0)//endifif TDSL=9 thenL=(low<low[3] and low<low[2]) or (low[1]<low[2] and low[1]<low[3])bearishflip=0TDSL=0BuySetup=1if L thenBuyConditionTDSetup = 1 //DRAWARROWUP(barindex,low-20*pipsize) coloured(0,255,0)endifendif//if TDSS>0 and TDSS<10 then//SetBuyLimit1 = Highest[TDSL](price)//TDSTResistance = Highest[TDSL](Close) //drawtext("#TDSS#",barindex,high+10*pipsize) coloured(255,0,0)//endifif TDSS=9 thenS=(high>high[2] and high>high[3]) or (high[1]>high[3] and high[1]>high[2])bullishflip=0TDSS=0SellSetup=1if S thenShortConditionTDSetup = 1 //DRAWARROWDOWN(barindex,high+20*pipsize) coloured(255,0,0)endifendifif BuySetup thenif close<=low[2] thenBuyCountdown=BuyCountdown+1//drawtext("#BuyCountdown#",barindex,low-10*pipsize) coloured(0,0,255)endifif BuyCountdown=8 thenBar8=barindexelsif BuyCountdown=13 then // TD Countdown perfection buyif low<=close[barindex-Bar8] thenBuyConditionTDCount = 1 //DRAWARROWUP(barindex,low-20*pipsize) coloured(0,0,255)endifBuySetup=0BuyCountdown=0endifelsif SellSetup thenif close>=high[2] thenSellCountdown=SellCountdown+1//drawtext("#SellCountdown#",barindex,high+10*pipsize) coloured(0,0,255)endifif SellCountdown=8 thenBar8=barindexelsif SellCountdown=13 then //TD Countdown perfection sellif high>=close[barindex-Bar8] thenShortConditionTDCount = 1 //DRAWARROWDOWN(barindex,high+20*pipsize) coloured(0,0,255)endifSellSetup=0SellCountdown=0endifendif//OTHER indicators//indicator1 = SMI[11,3,5](close)//Indicator1 = Stochastic[11,3](close)//Indicator2 = Average[5](indicator1)//Indicator1 = Volume//indicator1, indicator2, indicator3 = CALL "Super BandPass(1)"//Indicator4 = Williams[11](close)//Indicator5 = RSI[11](close)Indicator6 = AroonUp[9]Indicator7 = AroonDown[9]Indicator8 = Volume//Buy Conditionsb0 = BuyConditionTDSetup = 1b1 = BuyConditionTDCount = 1//b2 = Lowest[t1](close)>TDSTSupport// Detection of TD Setup buy signal//b0 = Close[10]>Close[14] AND Close[9]< Close[13]//b1 = 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 - perfection//b2 = Close OR Close[2] < Low[6]//b3 = Close OR Close [2] < Low[7]// Bullish Engulfingb2 = Close[2]>Close[3]b3 = Close[1]>Open[2] AND Open[1]<Close[2]b4 = Open>Close[1]//b5 = Indicator3 CROSSES OVER Indicator1//b4 = Indicator1 CROSSES OVER Indicator3//b4 = Indicator1 CROSSES OVER Indicator2 //AND Indicator1 > t5 ///Indicator1 CROSSES OVER Indicator2 AND//b5 = Indicator4 < - t3//b6 = Indicator5 < t2b7 = Indicator6 > 70b8 = Indicator7 < 30b9 = Indicator8 > 400BuyConditions = b0 AND b1 AND b2 AND b3 AND b4 AND b7 AND b8 AND b9 //AND b4 //b2 AND b3 AND b4 AND b5// Conditions to enter long positionsIF NOT LongOnMarket AND BuyConditions THENBUY 1 CONTRACTS AT MARKETENDIF// Conditions to exit long positionsbe1 = Open[1]>Close[2] AND Close[1]<Open[2] AND Open<Open[1]//be2 = POSITIONPERF > 1.5 AND Lowest[7](Close) < Lowest[14](Close)be2 = Average[20](close) CROSSES UNDER Average[55](Close)/// Close > Average[20](Close)LongExitConditions = be1 AND be2//AND be2If LongOnMarket AND LongExitConditions THENSELL AT MARKETENDIF// ***** Short Conditions *****s0 = ShortConditionTDSetup = 1s1 = ShortConditionTDCount = 1//s3 = Highest[t1](close) < TDSTResistance// Detection of TD Setup Sell signal//s0 = Close[10]<Close[14] AND Close[9]>Close[13]//s1= 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 - perfection//s2 = Close OR Close[2] > Low[6]//s3 = Close OR Close [2] > Low[7]// Engulfings2 = Close[2]<Close[3]s3 = Close[1]<Open[2] AND Open[1]>Close[2]s4 = Open<Close[1]//s5 = Indicator3 CROSSES UNDER Indicator2///s5 = Indicator4 > -t1//s6 = Indicator5 > t4//s4 = Indicator1 CROSSES UNDER Indicator2//s4 = Indicator1 CROSSES UNDER Indicator2 //AND Indicator1 < 80 //Indicator1 CROSSES UNDER Indicator2 AND Indicator1 < t2s7 = Indicator6 < 30s8 = Indicator7 > 70s9 = Indicator8 > 400ShortConditions = s0 AND s1 AND s2 AND s3 AND s4 AND s7 AND s8 AND s9// AND s5 //s2 AND s3 AND s4 AND s5// Conditions to enter short positionsIF NOT ShortOnMarket AND ShortConditions THENSELLSHORT 1 CONTRACTS AT MARKETENDIF//// ***** SHORT EXIT CONDITIONSse1 = Open[1]<Close[2] AND Close[1]>Open[2] AND Open>Open[1]//se2 = Close>Open AND High = Close AND (Open-Low) >= 3*(Close-Open)//se3 = POSITIONPERF > t1 AND Highest[7](Close) > Highest[14](Close)se2 = Average[20](close) CROSSES OVER Average[55](Close)ShortExitConditions = se1 AND se2 //AND se3 //OR se2) AND se3// Conditions to exit short positionsIF ShortOnMarket AND ShortExitConditions THENEXITSHORT AT MARKETENDIF// Stops and targets : Enter your protection stops and profit targets here//IF LongOnMarket Then//SET TARGET PPROFIT SetLimit1//SET STOP LOSS SetLimit2//ENDIF//IF ShortOnMarket Then//SET TARGET PROFIT SetLimit1//SET STOP LOSS SetLimit2//ENDIFSET TARGET PROFIT 100 //90//profSET STOP PLOSS 40 //30 //los1// 30// **** Stops and targets ***//DYNAMIC TRAILING STOPSL = 40 //30 //los1 //30 // Initial SL//TP = 30TSL = 1 // Use TSL?TrailingDistance = Round(0.85*SL) //Round(0.5*SL) // Distance from close to TSLTrailingStep = 9 //15 //3 // Pips locked at start of TSL//************************************************************************IF TSL = 1 THEN//reset the stoploss valueIF NOT ONMARKET THENnewSL = 0CAND = 0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL = 0 AND CLOSE - TRADEPRICE(1) >= TrailingDistance*PipSize THENnewSL = TRADEPRICE(1) + TrailingStep*PipSizeENDIF//next movesCAND = BarIndex - TradeIndexIF newSL > 0 AND CLOSE[1] >= HIGHEST[CAND](CLOSE) THENnewSL = CLOSE[1] - TrailingDistance*PipSizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL = 0 AND TRADEPRICE(1) - CLOSE[1] >= TrailingDistance*PipSize THENnewSL = TRADEPRICE(1) - TrailingStep*PipSizeENDIF//next movesCAND = BarIndex - TradeIndexIF newSL > 0 AND CLOSE[1] <= LOWEST[CAND](CLOSE) THENnewSL = CLOSE[1] + TrailingDistance*PipSizeENDIFENDIF//stop order to exit the positionsIF newSL > 0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIFSET STOP pLOSS SLENDIF//trailing stop//longtrail = 13//shorttrail = 7//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>=shorttrail*pointsize then //if the MFE is higher than the trailingstop then//priceexit = MINPRICE+shorttrail*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)>=longtrail*pointsize then //if the MFE is higher than the trailingstop then//priceexit = MAXPRICE-longtrail*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//endif04/18/2018 at 9:58 AM #68665Hi Baaz,
This was quite some time that I worked on this indicator but I remember that I found several small bugs in it after I uploaded it to the library. I corrected the indicator but I never uploaded the corrected version to the library. I attach now the new version here.
Another thing you want to keep in mind when using this indicator is to disable IG’s sunday candle. Otherwise the counts are getting wrong.
I also remember that I coded DeMarks support and resistance lines as he specifies but the results where not encouraging.
@Nicolas: Maybe you can update the version in the library with this one here? -
AuthorPosts
Find exclusive trading pro-tools on