any TD deMark countdown to point 13 ?

#1
most AFL out there with TD setup point 9 like below,
but is there anyone got the countdown to buy or sell point 13 ?

_SECTION_BEGIN("TD setup Perl");
//TD Buy Setup
TDBuySetup = Sum(C < Ref(C, -4), 9) == 9 AND Ref(C, -9) > Ref(C, -13);

//TD Sell Setup
TDSellSetup = Sum(C > Ref(C, -4), 9) == 9 AND Ref(C, -9) < Ref(C, -13);

//TDST Support
TDST_Support = ValueWhen(TDSellSetup, LLV(L, 9));
Plot(TDST_Support, "TDST Support", colorAqua, styleLine);

//TDST Resistance
TDST_Resistance = ValueWhen(TDBuySetup, HHV(H, 9));
Plot(TDST_Resistance, "TDST Resistence", colorLightOrange, styleLine);

//TD Buy Setup "Perfection"
TDBS_P = (L <= Ref(L, -2) & L <= Ref(L, -3)) | (Ref(L, -1) <= Ref(L, -2) & Ref(L, -1) <= Ref(L, -3));

//TD Sell Setup "Perfection"
TDSS_P = (H >= Ref(H, -2) & H >= Ref(H, -3)) | (Ref(H, -1) >= Ref(H, -2) & Ref(H, -1) >= Ref(H, -3));

//Perl's Rules for Trading TD Buy Setups Objectively
TradingTDBS = TDBuySetup & TDBS_P & (LLV(C, 9) > TDST_Support);

//Perl's Rules for Trading TD Sell Setups Objectively
TradingTDSS = TDSellSetup & TDSS_P & (HHV(C, 9) < TDST_Resistance);

//TD Buy Risk Level
TDBS_RL = IIf(L < Ref(L, -1), TDST_Support - (H - L), IIf(Ref(L, -1) < L, TDST_Support - (Ref(H, -1) - Ref(L, -1)), IIf(L == Ref(L, -1), TDST_Support - Max(H - L, Ref(H, -1) - Ref(L, -1)), 0)));


//TD Sell Risk Level
TDSS_RL = IIf(H > Ref(H, -1), TDST_Resistance + (H - L), IIf(Ref(H, -1) > H, TDST_Resistance + (Ref(H, -1) - Ref(L, -1)), IIf(H == Ref(H, -1), TDST_Resistance + Max(H - L, Ref(H, -1) - Ref(L, -1)), 0)));

TDBS_C = ((TDST_Resistance - C) / (C - TDBS_RL)) >= 1.5;
Plot(IIf(TradingTDBS & TDBS_C, TDBS_RL, Null), "", colorRed, styleDots);
PlotShapes(IIf(TradingTDBS & TDBS_C, shapeSmallSquare, shapeNone), colorBrightGreen, 0, L);
TDSS_C = ((C - TDST_Support) / (TDSS_RL - C)) >= 1.5;
Plot(IIf(TradingTDSS & TDSS_C, TDSS_RL, Null), "", colorRed, styleDots);
PlotShapes(IIf(TradingTDSS & TDSS_C, shapeSmallSquare, shapeNone), colorBrightGreen, 0, H);

//Show Numbers & Stop Loss
d = 0.5 * ATR(10);
for(i = 0; i < BarCount; i++) {
if (TDBuySetup) {
if (TradingTDBS & TDBS_C)
PlotText("Stop Loss\n@" + NumToStr(TDBS_RL, 1.2), i, TDBS_RL - d, colorRed);
for (j = 0; j < 9; j++) {
PlotText(NumToStr(9 - j, 1.0), i - j, L[i - j] - d, colorGreen);
}
}
if(TDSellSetup) {
if (TradingTDSS & TDSS_C)
PlotText("Stop Loss\n@" + NumToStr(TDSS_RL, 1.2), i, TDSS_RL + d, colorRed);
for (j = 0; j < 9; j++)
PlotText(NumToStr(9 - j, 1.0), i - j, H[i - j] + d, colorRed);
}
}

//Price
Plot(C, "Close", IIf((TDBuySetup & TDBS_P) | (TDSellSetup & TDSS_P), colorYellow, colorLavender), styleBar, Null, Null, 0, 0);

Title = "{{DATE}} - "+ Name() + " - " + " Open = " + NumToStr(O, 1.2) + ", High = " + NumToStr(H, 1.2) + ", Low = " + NumToStr(L, 1.2) + ", Close = " + NumToStr(C, 1.2) + "\n" +
EncodeColor(colorAqua) + "TDST Support" + EncodeColor(colorDefault) + " = " + NumToStr(TDST_Support, 1.2) + ", " + EncodeColor(colorLightOrange) + "TDST Resistance" + EncodeColor(colorDefault) + " = " + NumToStr(TDST_Resistance, 1.2) + "\n" +
WriteIf(TDBuySetup, WriteIf(TDBS_P, EncodeColor(colorYellow) + "Perfected" + EncodeColor(colorDefault), "Unperfected ") + " TD Buy Setup\n", "") +
WriteIf(TDSellSetup, WriteIf(TDSS_P, EncodeColor(colorYellow) + "Perfected" + EncodeColor(colorDefault), "Unperfected ") + " TD Sell Setup\n", "") +
WriteIf(TDBuySetup, "\nPerl's Rules for Trading TD Buy Setups Objectively\n" +
"1. When the TD Buy Setup has been perfected, that is, the low of TD Buy Setup bar eight or nine is less than the lows of TD Buy Setup bars six and seven, " + WriteIf(TDBS_P, "[" + EncodeColor(colorBrightGreen) + "Yes" + EncodeColor(colorDefault) + "]", "[" + EncodeColor(colorRed) + "No" + EncodeColor(colorDefault) + "]") + "\n" +
"2. When none of the bars within the TD Buy Setup has closed below TDST support, " + WriteIf((LLV(C, 9) > TDST_Support), "[" + EncodeColor(colorBrightGreen) + "Yes" + EncodeColor(colorDefault) + "]", "[" + EncodeColor(colorRed) + "No" + EncodeColor(colorDefault) + "]") + "\n" +
"3. When the Close of TD Buy Setup bar nine is in Close proximity to TDST support. " + WriteIf(TDBS_C, "[" + EncodeColor(colorBrightGreen) + "Yes" + EncodeColor(colorDefault) + "]", "[" + EncodeColor(colorRed) + "No" + EncodeColor(colorDefault) + "]"), "") +
WriteIf(TDSellSetup, "\nPerl's Rules on When to Initiate a Short Position Following a Completed TD Sell Setup\n" +
"1. When the TD Sell Setup has been perfected,that is,when the high of TD Sell Setup bar eight or nine is greater than the highs of TD Sell Setup bars six and seven, " + WriteIf(TDSS_P, "[" + EncodeColor(colorBrightGreen) + "Yes" + EncodeColor(colorDefault) + "]", "[" + EncodeColor(colorRed) + "No" + EncodeColor(colorDefault) + "]") + "\n" +
"2. When none of the bars within the TD Sell Setup has closed above TDST resistance, " + WriteIf((HHV(C, 9) < TDST_Resistance), "[" + EncodeColor(colorBrightGreen) + "Yes" + EncodeColor(colorDefault) + "]", "[" + EncodeColor(colorRed) + "No" + EncodeColor(colorDefault) + "]") + "\n" +
"3. When the close of TD Sell Setup bar nine is in close proximity to TDST resistance. " + WriteIf(TDSS_C, "[" + EncodeColor(colorBrightGreen) + "Yes" + EncodeColor(colorDefault) + "]", "[" + EncodeColor(colorRed) + "No" + EncodeColor(colorDefault) + "]"), "") +
WriteIf(TradingTDBS & TDBS_C, "\n\n" + EncodeColor(colorBrightGreen) + "Trading a TD Buy Setup" + EncodeColor(colorDefault) + "\nEntry price = " + NumToStr(C, 1.2) + "\nStop loss = " + NumToStr(TDBS_RL, 1.2) + "\nRisk return = " + NumToStr((TDST_Resistance - C) / (C - TDBS_RL), 1.2), "") +
WriteIf(TradingTDSS & TDSS_C, "\n\n" + EncodeColor(colorBrightGreen) + "Trading a TD Sell Setup" + EncodeColor(colorDefault) + "\nEntry price = " + NumToStr(C, 1.2) + "\nStop loss = " + NumToStr(TDSS_RL, 1.2) + "\nRisk return = " + NumToStr((C - TDST_Support) / (TDSS_RL - C), 1.2), "");

Buy = TradingTDBS & TDBS_C;
Short = TradingTDSS & TDSS_C;
_SECTION_END();
 
#2
most AFL out there with TD setup point 9 like below,
but is there anyone got the countdown to buy or sell point 13 ?

_SECTION_BEGIN("TD setup Perl");
//TD Buy Setup
TDBuySetup = Sum(C < Ref(C, -4), 9) == 9 AND Ref(C, -9) > Ref(C, -13);

//TD Sell Setup
TDSellSetup = Sum(C > Ref(C, -4), 9) == 9 AND Ref(C, -9) < Ref(C, -13);

//TDST Support
TDST_Support = ValueWhen(TDSellSetup, LLV(L, 9));
Plot(TDST_Support, "TDST Support", colorAqua, styleLine);

//TDST Resistance
TDST_Resistance = ValueWhen(TDBuySetup, HHV(H, 9));
Plot(TDST_Resistance, "TDST Resistence", colorLightOrange, styleLine);

//TD Buy Setup "Perfection"
TDBS_P = (L <= Ref(L, -2) & L <= Ref(L, -3)) | (Ref(L, -1) <= Ref(L, -2) & Ref(L, -1) <= Ref(L, -3));

//TD Sell Setup "Perfection"
TDSS_P = (H >= Ref(H, -2) & H >= Ref(H, -3)) | (Ref(H, -1) >= Ref(H, -2) & Ref(H, -1) >= Ref(H, -3));

//Perl's Rules for Trading TD Buy Setups Objectively
TradingTDBS = TDBuySetup & TDBS_P & (LLV(C, 9) > TDST_Support);

//Perl's Rules for Trading TD Sell Setups Objectively
TradingTDSS = TDSellSetup & TDSS_P & (HHV(C, 9) < TDST_Resistance);

//TD Buy Risk Level
TDBS_RL = IIf(L < Ref(L, -1), TDST_Support - (H - L), IIf(Ref(L, -1) < L, TDST_Support - (Ref(H, -1) - Ref(L, -1)), IIf(L == Ref(L, -1), TDST_Support - Max(H - L, Ref(H, -1) - Ref(L, -1)), 0)));


//TD Sell Risk Level
TDSS_RL = IIf(H > Ref(H, -1), TDST_Resistance + (H - L), IIf(Ref(H, -1) > H, TDST_Resistance + (Ref(H, -1) - Ref(L, -1)), IIf(H == Ref(H, -1), TDST_Resistance + Max(H - L, Ref(H, -1) - Ref(L, -1)), 0)));

TDBS_C = ((TDST_Resistance - C) / (C - TDBS_RL)) >= 1.5;
Plot(IIf(TradingTDBS & TDBS_C, TDBS_RL, Null), "", colorRed, styleDots);
PlotShapes(IIf(TradingTDBS & TDBS_C, shapeSmallSquare, shapeNone), colorBrightGreen, 0, L);
TDSS_C = ((C - TDST_Support) / (TDSS_RL - C)) >= 1.5;
Plot(IIf(TradingTDSS & TDSS_C, TDSS_RL, Null), "", colorRed, styleDots);
PlotShapes(IIf(TradingTDSS & TDSS_C, shapeSmallSquare, shapeNone), colorBrightGreen, 0, H);

//Show Numbers & Stop Loss
d = 0.5 * ATR(10);
for(i = 0; i < BarCount; i++) {
if (TDBuySetup) {
if (TradingTDBS & TDBS_C)
PlotText("Stop Loss\n@" + NumToStr(TDBS_RL, 1.2), i, TDBS_RL - d, colorRed);
for (j = 0; j < 9; j++) {
PlotText(NumToStr(9 - j, 1.0), i - j, L[i - j] - d, colorGreen);
}
}
if(TDSellSetup) {
if (TradingTDSS & TDSS_C)
PlotText("Stop Loss\n@" + NumToStr(TDSS_RL, 1.2), i, TDSS_RL + d, colorRed);
for (j = 0; j < 9; j++)
PlotText(NumToStr(9 - j, 1.0), i - j, H[i - j] + d, colorRed);
}
}

//Price
Plot(C, "Close", IIf((TDBuySetup & TDBS_P) | (TDSellSetup & TDSS_P), colorYellow, colorLavender), styleBar, Null, Null, 0, 0);

Title = "{{DATE}} - "+ Name() + " - " + " Open = " + NumToStr(O, 1.2) + ", High = " + NumToStr(H, 1.2) + ", Low = " + NumToStr(L, 1.2) + ", Close = " + NumToStr(C, 1.2) + "\n" +
EncodeColor(colorAqua) + "TDST Support" + EncodeColor(colorDefault) + " = " + NumToStr(TDST_Support, 1.2) + ", " + EncodeColor(colorLightOrange) + "TDST Resistance" + EncodeColor(colorDefault) + " = " + NumToStr(TDST_Resistance, 1.2) + "\n" +
WriteIf(TDBuySetup, WriteIf(TDBS_P, EncodeColor(colorYellow) + "Perfected" + EncodeColor(colorDefault), "Unperfected ") + " TD Buy Setup\n", "") +
WriteIf(TDSellSetup, WriteIf(TDSS_P, EncodeColor(colorYellow) + "Perfected" + EncodeColor(colorDefault), "Unperfected ") + " TD Sell Setup\n", "") +
WriteIf(TDBuySetup, "\nPerl's Rules for Trading TD Buy Setups Objectively\n" +
"1. When the TD Buy Setup has been perfected, that is, the low of TD Buy Setup bar eight or nine is less than the lows of TD Buy Setup bars six and seven, " + WriteIf(TDBS_P, "[" + EncodeColor(colorBrightGreen) + "Yes" + EncodeColor(colorDefault) + "]", "[" + EncodeColor(colorRed) + "No" + EncodeColor(colorDefault) + "]") + "\n" +
"2. When none of the bars within the TD Buy Setup has closed below TDST support, " + WriteIf((LLV(C, 9) > TDST_Support), "[" + EncodeColor(colorBrightGreen) + "Yes" + EncodeColor(colorDefault) + "]", "[" + EncodeColor(colorRed) + "No" + EncodeColor(colorDefault) + "]") + "\n" +
"3. When the Close of TD Buy Setup bar nine is in Close proximity to TDST support. " + WriteIf(TDBS_C, "[" + EncodeColor(colorBrightGreen) + "Yes" + EncodeColor(colorDefault) + "]", "[" + EncodeColor(colorRed) + "No" + EncodeColor(colorDefault) + "]"), "") +
WriteIf(TDSellSetup, "\nPerl's Rules on When to Initiate a Short Position Following a Completed TD Sell Setup\n" +
"1. When the TD Sell Setup has been perfected,that is,when the high of TD Sell Setup bar eight or nine is greater than the highs of TD Sell Setup bars six and seven, " + WriteIf(TDSS_P, "[" + EncodeColor(colorBrightGreen) + "Yes" + EncodeColor(colorDefault) + "]", "[" + EncodeColor(colorRed) + "No" + EncodeColor(colorDefault) + "]") + "\n" +
"2. When none of the bars within the TD Sell Setup has closed above TDST resistance, " + WriteIf((HHV(C, 9) < TDST_Resistance), "[" + EncodeColor(colorBrightGreen) + "Yes" + EncodeColor(colorDefault) + "]", "[" + EncodeColor(colorRed) + "No" + EncodeColor(colorDefault) + "]") + "\n" +
"3. When the close of TD Sell Setup bar nine is in close proximity to TDST resistance. " + WriteIf(TDSS_C, "[" + EncodeColor(colorBrightGreen) + "Yes" + EncodeColor(colorDefault) + "]", "[" + EncodeColor(colorRed) + "No" + EncodeColor(colorDefault) + "]"), "") +
WriteIf(TradingTDBS & TDBS_C, "\n\n" + EncodeColor(colorBrightGreen) + "Trading a TD Buy Setup" + EncodeColor(colorDefault) + "\nEntry price = " + NumToStr(C, 1.2) + "\nStop loss = " + NumToStr(TDBS_RL, 1.2) + "\nRisk return = " + NumToStr((TDST_Resistance - C) / (C - TDBS_RL), 1.2), "") +
WriteIf(TradingTDSS & TDSS_C, "\n\n" + EncodeColor(colorBrightGreen) + "Trading a TD Sell Setup" + EncodeColor(colorDefault) + "\nEntry price = " + NumToStr(C, 1.2) + "\nStop loss = " + NumToStr(TDSS_RL, 1.2) + "\nRisk return = " + NumToStr((C - TDST_Support) / (TDSS_RL - C), 1.2), "");

Buy = TradingTDBS & TDBS_C;
Short = TradingTDSS & TDSS_C;
_SECTION_END();


Thanks for posting the AFL. I have one AFL where apart from the TDST levels making , it prints a yellow arrow on Sequential Countdown 13 Sell bar and Green arrow on Sequential countdown buy. If you dont have that AFL, Let me know, I can post it .

Smart_trade
 
#4
Here we go....

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
ToolTip = "Open = " + O + "\nHigh = " + H + "\nLow = " + L + "\nClose = " + C;

_SECTION_END();

_SECTION_BEGIN("TD Systems");
// Parameters
ShowNumbers= ParamToggle("Show 1-8 Numbers","No|Yes", 1);
ShowTDPoints = ParamToggle("Show TD Points", "No|Yes", 1);
ShowTDST = ParamToggle("Show TD Setup Trend", "No|Yes", 1);
tdstsa = 0;
tdstba = 0;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//********************************************** TD Points********************************************************************/
function TD_Supply()
{
return ( H > Ref(H, 1) AND H > Ref(H, -1) AND H > Ref(C, -2));
}
function TD_Demand()
{
return ( L < Ref(L, 1) AND L < Ref(L, -1) AND L < Ref(C, -2));
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// *********************************************** TD Sequential************************************************************/
// *** Setup Buy Signal ***
//nine consecutive days closes less than the close four days earlier
Con = C < Ref( C, -4);
Buy9Bars = BarsSince(BarsSince(Con));
Buy9Signal = Buy9Bars == 9;

// *** Requirements ***
//The first day of the nine-day must be preceded by a close day immediately before it that is greater than OR equal to the Close four days earlier
Con = Ref(C, -9) >= Ref(C, -13);
Buy9Req = Buy9Signal AND Con;

// *** Intersection ***
// the high of either day 8 or day 9 is greater than or equal to the low three,four, five, six, OR seven days earlier
Con1 = (H >= Ref(L, -3)) OR ( Ref(H, -1) >= Ref(L, -3));
Con2 = (H >= Ref(L, -4)) OR ( Ref(H, -1) >= Ref(L, -4));
Con3 = (H >= Ref(L, -5)) OR ( Ref(H, -1) >= Ref(L, -5));
Con4 = (H >= Ref(L, -6)) OR ( Ref(H, -1) >= Ref(L, -6));
Con5 = (H >= Ref(L, -7)) OR ( Ref(H, -1) >= Ref(L, -7));

Buy9Intr = Buy9Req AND (Con1 OR Con2 OR Con3 OR Con4 OR Con5);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// *** Setup Sell Signal ***
//nine consecutive days closes greater than the Close four days earlier.
Con = C > Ref( C, -4);
Sell9Bars = BarsSince(BarsSince(Con));
Sell9Signal = Sell9Bars == 9;

// *** Requirements ***
//The first day of the nine-day must be preceded by a Close day immediately before it that is less than the Close four days earlier
Con = Ref(C, -9) < Ref(C, -13);
Sell9Req = Sell9Signal AND Con;

// *** Intersection ***
//the low of either day 8 or day 9 is less than or equal to the high three,four, five, six, OR seven days earlier
Con1 = (L <= Ref(H, -3)) OR ( Ref(L, -1) <= Ref(H, -3));
Con2 = (L <= Ref(H, -4)) OR ( Ref(L, -1) <= Ref(H, -4));
Con3 = (L <= Ref(H, -5)) OR ( Ref(L, -1) <= Ref(H, -5));
Con4 = (L <= Ref(H, -6)) OR ( Ref(L, -1) <= Ref(H, -6));
Con5 = (L <= Ref(H, -7)) OR ( Ref(L, -1) <= Ref(H, -7));

Sell9Intr = Sell9Req AND (Con1 OR Con2 OR Con3 OR Con4 OR Con5);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(StrToNum(NumToStr(Buy9Intr))) Sell9Intr = False;
if(StrToNum(NumToStr(Sell9Intr))) Buy9Intr = False;
BuySignal = Flip(Buy9Intr, Sell9Intr);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// *** Buy Countdown ***
//With respect to a pending Buy Signal, the close must be less than the low two days earlier
Con = C < Ref(L, -2);
Buy13Count = Sum(Con AND BuySignal, BarsSince(Buy9Intr));
Buy13Signal = Buy13Count == 13;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// *** Sell Countdown ***
//with respect to a pending Sell Signal, the Close must be greater than the High two trading days earlier.
Con = C > Ref(H, -2);
Sell13Count = Sum(Con AND NOT BuySignal, BarsSince(Sell9Intr));
Sell13Signal = Sell13Count == 13;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//*********************************************** TD Sequential Plotting area *************************************************/
Plot(C, "", IIf(O>=C, colorRed, colorGreen), styleBar);
PlotShapes(IIf(Buy9Intr OR Sell9Intr, shapeDigit9, shapeNone),colorBlue, 0, H,
20);
if(ShowNumbers)
PlotShapes(IIf(Buy9Bars==1, shapeDigit1,
IIf(Buy9Bars==2, shapeDigit2,
IIf(Buy9Bars==3, shapeDigit3,
IIf(Buy9Bars==4, shapeDigit4,
IIf(Buy9Bars==5, shapeDigit5,
IIf(Buy9Bars==6, shapeDigit6,
IIf(Buy9Bars==7, shapeDigit7,
IIf(Buy9Bars==8, shapeDigit8,
IIf(Buy9Bars >9, shapeStar,shapeNone))))))))),colorGreen, 0, H, H*.0015);
if(ShowNumbers)
PlotShapes(
IIf(Sell9Bars==1, shapeDigit1,
IIf(Sell9Bars==2, shapeDigit2,
IIf(Sell9Bars==3, shapeDigit3,
IIf(Sell9Bars==4, shapeDigit4,
IIf(Sell9Bars==5, shapeDigit5,
IIf(Sell9Bars==6, shapeDigit6,
IIf(Sell9Bars==7, shapeDigit7,
IIf(Sell9Bars==8, shapeDigit8,
IIf(sell9bars>9, shapeStar,shapeNone))))))))),colorRed, 0, H, H*.0015);

Sell = Sell13Signal AND NOT BuySignal;
Buy = Buy13Signal AND BuySignal;
Sell = ExRem(Sell, Buy);
Buy = ExRem(Buy, Sell);
PlotShapes(Sell*shapeDownArrow, colorYellow, 0, H, -H*.001);
PlotShapes(Buy*shapeUpArrow, colorBrightGreen, 0, L, -L*.001);

if(StrToNum(NumToStr(BuySignal)))
bgColor = ColorRGB(0,66, 2);
else
bgColor = ColorRGB(66,2, 0);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//*********************************************** TD Points Plotting area *************************************************/
if(ShowTDPoints)
{
PlotShapes(TD_Supply()*shapeSmallCircle, colorRed, 0, H, H*.001);
PlotShapes(TD_Demand()*shapeSmallCircle, colorGreen, 0, L, -L*.001);
///////////////////////////////////////////////////////////////////////////
y0 = StrToNum(NumToStr(ValueWhen(TD_Demand(), L)));
x = LineArray(0, y0, (BarCount-1), y0);
Plot(x, "", colorGold, styleDashed);
y0 = StrToNum(NumToStr(ValueWhen(TD_Supply(), H)));
x = LineArray(0, y0, (BarCount-1), y0);
Plot(x, "", colorGold, styleDashed);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//*********************************************** TDST Plotting area *************************************************/
// ---------------->>>> Code from Dave <<<---------------------- //
if(ShowTDST)
{
tdstba =Cum(0);
tdstb = Null;
HHV9 = HHV(H,9);
for (i = 0; i < 10; i++) tdstba = Null;

for( i = 10; i < BarCount; i++ )
{
if (Buy9Bars == 9)
{
HHV_b = HHV9;
if (HHV_b > C[i-9])
tdstb = HHV_b;
else tdstb = C[i-9];

for (j = 0; j < 9; j++ )
tdstba[i-j] = tdstb;
}
else tdstba = tdstb;
}

tdstsa =Cum(0);
tdsts = Null;
LLV9 = LLV(L,9);
for (i = 0; i < 10; i++) tdstsa = Null;

for( i = 10; i < BarCount; i++ )
{
if (Sell9Bars == 9)
{
LLV_b = LLV9;
if (LLV_b < C[i-9])
tdsts = LLV_b;
else tdsts = C[i-9];

for (j = 0; j < 9; j++ )
tdstsa[i-j] = tdsts;
}
else tdstsa = tdsts;
}
Plot(tdstba, "TDSTb", colorBlue,styleStaircase | styleThick|styleDots);
Plot(tdstsa, "TDSTs", colorRed,styleStaircase | styleThick|styleDots);

}
_SECTION_END();

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

From Param disable first 2 choice to get the clear chart.

Disclaimer : This AFL is not written by me. I got it from the net but now dont remember the source....All credit to the guy who wrote it.

Smart_trade
 
#7
Any advantage with any of this afl talked in real trading?

If so, kindly explain the odds with RR we would get with any of such afl but please be very quit about it as any super dooper pro systems are looking for such afls.

Pleassssss I have not posted this post
 
#8
thanks for sharing.
this one only count to 9,
demark, after setup count up to 9,
then another new count up from 1 to 13
Yes as I told you this does not give Countdown markings but on 13 th countdown it gives yellow arrow and green arrow indicating that it is a 13th countdown bar. If you check manually ,then the marking is on correct 13 CD bar.

Smart_trade
 
#9
Any advantage with any of this afl talked in real trading?

If so, kindly explain the odds with RR we would get with any of such afl but please be very quit about it as any super dooper pro systems are looking for such afls.

Pleassssss I have not posted this post
Huge advantage Dan, this method identifies price exhaustion very accurately. The recent low in Nifty was perfectly identified by this method and it has mechanical way of counting.Also Nifty over 9200 top was indicated.It works in commodities, forex,bonds,stocks and indices.These signals have over 70 % success rate and reward to risk ratio of 4 or 5:1 or more.The recent bottom I had posted in real time in our forum.

These systems are in public domain and many large funds use if for their trading/investments. These are long term systems so we get a signal in 4-6 months but the precision with which it identifies price exhaustion and reversal is very good.

I have benefited hugely by these methods.

Smart_trade
 

Similar threads